View | Details | Raw Unified | Return to bug 8532
Collapse All | Expand All

(-)a/Koha/DateUtils.pm (-2 / +3 lines)
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 106-111 sub output_pref { Link Here
106
    my $force_pref = shift;    # if testing we want to override Context
107
    my $force_pref = shift;    # if testing we want to override Context
107
    my $pref =
108
    my $pref =
108
      defined $force_pref ? $force_pref : C4::Context->preference('dateformat');
109
      defined $force_pref ? $force_pref : C4::Context->preference('dateformat');
110
    return undef unless defined($dt);
109
    given ($pref) {
111
    given ($pref) {
110
        when (/^iso/) {
112
        when (/^iso/) {
111
            return $dt->strftime('%Y-%m-%d %H:%M');
113
            return $dt->strftime('%Y-%m-%d %H:%M');
112
- 

Return to bug 8532