From ca908b5541de337d9be0d7c0062879c0d34cb583 Mon Sep 17 00:00:00 2001 From: kados Date: Sat, 10 Mar 2007 00:28:11 +0000 Subject: [PATCH] adding back get_date_format_string_for_DHTMLcalendar --- C4/Date.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/C4/Date.pm b/C4/Date.pm index 09ed758d61..6451784bc4 100644 --- a/C4/Date.pm +++ b/C4/Date.pm @@ -28,6 +28,7 @@ $VERSION = 0.01; @EXPORT = qw( &display_date_format + &get_date_format_string_for_DHTMLcalendar &format_date &format_date_in_iso ); @@ -62,6 +63,24 @@ sub display_date_format } } +sub get_date_format_string_for_DHTMLcalendar { + my $dateformat = get_date_format(); + + if ( $dateformat eq 'us' ) { + return '%m/%d/%Y'; + } + elsif ( $dateformat eq 'metric' ) { + return '%d/%m/%Y'; + } + elsif ( $dateformat eq "iso" ) { + return '%Y-%m-%d'; + } + else { + return 'Invalid date format: ' + . $dateformat . '.' + . ' Please change in system preferences'; + } +} sub format_date { -- 2.39.2