Dates.pm: Added functions format_date and format_date_in_iso as possible drop-in replacements for
Signed-off-by: Chris Cormack <crc@liblime.com> Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
eac81e3d8b
commit
b73e4e924e
1 changed files with 9 additions and 1 deletions
10
C4/Dates.pm
10
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__
|
||||
|
||||
|
|
Loading…
Reference in a new issue