Skip to content

Commit

Permalink
Merge pull request #8543 from ehuelsmann/fix/1.12/user-date-formatting
Browse files Browse the repository at this point in the history
Fix date formatting on payment screen
  • Loading branch information
ehuelsmann authored Dec 14, 2024
2 parents 8fc1c35 + 7500e91 commit 037b53e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
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 @@ -775,6 +779,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

0 comments on commit 037b53e

Please sign in to comment.