From 8d9e05d07cb5a17e0a32e36bb1e5624db0fad84f Mon Sep 17 00:00:00 2001 From: bob_lyon Date: Mon, 27 Nov 2006 00:27:43 +0000 Subject: [PATCH] Added in ability for the calendar popup to work for the preferenced date format --- bull/subscription-add.pl | 16 +++++++++++++--- .../npl/en/bull/subscription-add.tmpl | 8 ++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/bull/subscription-add.pl b/bull/subscription-add.pl index fc351a281d..9c5c0c998f 100755 --- a/bull/subscription-add.pl +++ b/bull/subscription-add.pl @@ -277,9 +277,19 @@ if(C4::Context->preference("RoutingSerials")){ } push( @sub_type_data, \%row ); } - $template->param(subtype => \@sub_type_data, - weekarrayjs => $weekarrayjs, - weekno => $weekno, + my $dateformat; + my $dateformatcode = C4::Context->preference('dateformat'); + if($dateformatcode eq 'US' || $dateformatcode eq 'us'){ + $dateformat = '%m/%d/%Y'; + } elsif ($dateformatcode eq 'ISO' || $dateformatcode eq 'iso'){ + $dateformat = '%Y/%m/%d'; + } else { + $dateformat = '%d/%m/%Y'; + } + $template->param(subtype => \@sub_type_data, + weekarrayjs => $weekarrayjs, + weekno => $weekno, + dateformat => $dateformat, ); output_html_with_http_headers $query, $cookie, $template->output; } diff --git a/koha-tmpl/intranet-tmpl/npl/en/bull/subscription-add.tmpl b/koha-tmpl/intranet-tmpl/npl/en/bull/subscription-add.tmpl index de0bca60d0..859dc43974 100644 --- a/koha-tmpl/intranet-tmpl/npl/en/bull/subscription-add.tmpl +++ b/koha-tmpl/intranet-tmpl/npl/en/bull/subscription-add.tmpl @@ -743,7 +743,7 @@ function check_input(e){