From b73e4e924ee79ba97b46bd2293180bcacb496e66 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Tue, 16 Oct 2007 16:02:28 -0500 Subject: [PATCH] Dates.pm: Added functions format_date and format_date_in_iso as possible drop-in replacements for Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Dates.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/C4/Dates.pm b/C4/Dates.pm index bfee3a563b..320d04d62b 100644 --- a/C4/Dates.pm +++ b/C4/Dates.pm @@ -24,7 +24,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = 0.03; @ISA = qw(Exporter); -@EXPORT_OK = qw(DHTMLcalendar); +@EXPORT_OK = qw(DHTMLcalendar format_date_in_iso format_date); my $prefformat = C4::Context->preference('dateformat'); my $debug = $ENV{'DEBUG'} || 0; @@ -132,6 +132,14 @@ sub visual { return $format_map{ eval { $self->{'dateformat'} } || $prefformat} ; } +# like the functions from the old C4::Date.pm +sub format_date { + return __PACKAGE__ -> new(shift,'iso')->output((@_) ? shift : $prefformat); +} +sub format_date_in_iso { + return __PACKAGE__ -> new(shift,$prefformat)->output('iso'); +} + 1; __END__ -- 2.39.5