]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1552778: make clean_ISO8601 recognize 'Z' as a timezone specifier
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 21 Sep 2018 18:30:01 +0000 (14:30 -0400)
committerKathy Lussier <klussier@masslnc.org>
Mon, 24 Sep 2018 18:41:04 +0000 (14:41 -0400)
commitb1c3b925764f6d8bf7cfe8b9f9c9a4ebe4c09d04
treec71b6146a5d86a748a5d782f39f71bb3cc521290
parent401fb4cc1a5a065d0b82692dae4f64a449d820f7
LP#1552778: make clean_ISO8601 recognize 'Z' as a timezone specifier

Prior to this patch, clean_ISO8601 would ignore 'Z' as a timezone
specifier (e.g., '2018-09-21T15:34:21Z') and treat it as if the
timestamp were in the server's time zone, leading to incorrect
results (e.g., '2018-09-21T15:34:21-04:00') unless user, client,
and server all happen to be in UTC+0.  In particular, this allows
date strings emitted by the JavaScript Date object's toISOString()
method to be correctly parsed, as those strings invariably use
'Z' as the timezone specifier.

To test
-------
[1] Apply patch.
[2] Verify that regression test in t/14-OpenILS-Utils.t passes.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/perlmods/lib/OpenILS/Utils/DateTime.pm
Open-ILS/src/perlmods/t/14-OpenILS-Utils.t