From: Terran McCanna Date: Wed, 20 May 2020 19:33:57 +0000 (-0400) Subject: LP1840950 Patron expiration date & iPads X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0e7b7e30bc28f534c36e5a767b7d6e86d1ee9965;p=evergreen%2Fpines.git LP1840950 Patron expiration date & iPads This resolves a problem where the patron expiration date was not displaying when editing a patron account on an iOS device because Safari did not allow the deprecated Date() function. This code uses javascript to reformat the date, similar to how the DOB on the same form is handled. Signed-off-by: Terran McCanna --- diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js index 6941f86879..83b3f0cc07 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js @@ -786,7 +786,7 @@ angular.module('egCoreMod') var patron = egCore.idl.toHash(current); patron.home_ou = egCore.org.get(patron.home_ou.id); - patron.expire_date = new Date(Date.parse(patron.expire_date)); + patron.expire_date = service.parse_expire_date(patron.expire_date); patron.dob = service.parse_dob(patron.dob); patron.profile = current.profile(); // pre-hash version patron.net_access_level = current.net_access_level(); @@ -902,6 +902,14 @@ angular.module('egCoreMod') return new Date(parts[0], parts[1] - 1, parts[2]) } + // parse expire date to reformat with correct time zone format_name + // TODO: move this into egDate ? + service.parse_expire_date = function(expire_date) { + if(!expire_date) return null; + var timezoneslice = expire_date.slice(0,22) + ":" + expire_date.slice(22,24); + return new Date(timezoneslice) + } + service.copy_stage_data = function(user) { var cuser = service.stage_user;