Lines 94-100
s/(\d{4})(\d{2})(\d{2})\s+(\d{2})(\d{2})(\d{2})/$1-$2-$3T$4:$5:$6/;
Link Here
|
94 |
|
94 |
|
95 |
$date_string = output_pref($dt, [$format] ); |
95 |
$date_string = output_pref($dt, [$format] ); |
96 |
|
96 |
|
97 |
Returns a string containing the time & date formatted as per the C4::Context setting |
97 |
Returns a string containing the time & date formatted as per the C4::Context setting, |
|
|
98 |
or C<undef> if C<undef> was provided. |
98 |
|
99 |
|
99 |
A second parameter allows overriding of the syspref value. This is for testing only |
100 |
A second parameter allows overriding of the syspref value. This is for testing only |
100 |
In usage use the DateTime objects own methods for non standard formatting |
101 |
In usage use the DateTime objects own methods for non standard formatting |
Lines 104-109
In usage use the DateTime objects own methods for non standard formatting
Link Here
|
104 |
sub output_pref { |
105 |
sub output_pref { |
105 |
my $dt = shift; |
106 |
my $dt = shift; |
106 |
my $force_pref = shift; # if testing we want to override Context |
107 |
my $force_pref = shift; # if testing we want to override Context |
|
|
108 |
|
109 |
return unless defined $dt; |
110 |
|
107 |
my $pref = |
111 |
my $pref = |
108 |
defined $force_pref ? $force_pref : C4::Context->preference('dateformat'); |
112 |
defined $force_pref ? $force_pref : C4::Context->preference('dateformat'); |
109 |
given ($pref) { |
113 |
given ($pref) { |
110 |
- |
|
|