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

(-)a/Koha/DateUtils.pm (-3 / +8 lines)
Lines 143-149 sub dt_from_string { Link Here
143
    }
143
    }
144
144
145
    # Add the faculative time part [hh:mm[:ss]]
145
    # Add the faculative time part [hh:mm[:ss]]
146
    my $time_re .= qr|
146
    my $time_re .= qr{
147
            (
147
            (
148
                [Tt]?
148
                [Tt]?
149
                \s*
149
                \s*
Lines 158-165 sub dt_from_string { Link Here
158
                    \s
158
                    \s
159
                    (?<ampm>\w{2})
159
                    (?<ampm>\w{2})
160
                )?
160
                )?
161
                (
162
                    (?<utc>[Zz]$)|((?<offset>[\+|\-])(?<hours>[01][0-9]|2[0-3]):(?<minutes>[0-5][0-9]))
163
                )?
161
            )?
164
            )?
162
    |xms;
165
    }xms;
163
    $regex .= $time_re unless ( $date_format eq 'rfc3339' );
166
    $regex .= $time_re unless ( $date_format eq 'rfc3339' );
164
    $fallback_re .= $time_re;
167
    $fallback_re .= $time_re;
165
168
Lines 175-180 sub dt_from_string { Link Here
175
            second => $+{second},
178
            second => $+{second},
176
        );
179
        );
177
        $ampm = $+{ampm};
180
        $ampm = $+{ampm};
181
        if ( $+{utc} ) {
182
            $tz = DateTime::TimeZone->new( name => 'UTC' );
183
        }
178
        if ( $+{offset} ) {
184
        if ( $+{offset} ) {
179
            # If offset given, set inbound timezone using it.
185
            # If offset given, set inbound timezone using it.
180
            $tz = DateTime::TimeZone->new( name => $+{offset} . $+{hours} . $+{minutes} );
186
            $tz = DateTime::TimeZone->new( name => $+{offset} . $+{hours} . $+{minutes} );
181
- 

Return to bug 29718