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)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 21 Sep 2018 18:34:12 +0000 (14:34 -0400)
commit3f99356cb0598cdb564c5d6d653bedca1285fca0
tree2a713c67a05272ec0c471adebdeef80dacc6c420
parent96ba7d419cb2de98b02800d0de7ae4aa7bae19c7
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>
Open-ILS/src/perlmods/lib/OpenILS/Utils/DateTime.pm
Open-ILS/src/perlmods/t/14-OpenILS-Utils.t