Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix date formatting on payment screen #8542

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/LedgerSMB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ Parses the $date given the session user's date formatting settings.

formats the $amount given the session user's number formatting settings.

=item format_date($date, %args)

formats the $date given the session user's date formatting settings.

=item formatter_options()

Returns a hashref containing the session user's number and date formatting
Expand Down Expand Up @@ -774,6 +778,16 @@ sub format_amount {
);
}

sub format_date {
my ($request, $date, %args) = @_;
my $config = $request->{_user};

return $date->to_output(
format => $config->{dateformat},
%args
);
}

sub formatter_options {
my ($request) = @_;
my $config = $request->{_user};
Expand Down
2 changes: 1 addition & 1 deletion lib/LedgerSMB/Scripts/payment.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ sub payment2 {
my @topay_state;
my @open_invoices = $Payment->get_open_invoices();
for my $invoice (@open_invoices) {
$invoice->{invoice_date} = $request->format_amount( $invoice->{invoice_date} );
$invoice->{invoice_date} = $request->format_date( $invoice->{invoice_date} );

if ($args{update}
&& ! $request->{"checkbox_$invoice->{invoice_id}"}) {
Expand Down
Loading