From 9fb37f079bb21a31c2cec561b85064df6b73d220 Mon Sep 17 00:00:00 2001 From: Dan Briem Date: Tue, 7 May 2019 17:52:53 -0400 Subject: [PATCH] Fix date of birth time zone change when saving patron In regctrl.js the date of birth converts from string to Date obj for the datepicker (00:00:00, local time zone) then back when saving using toISOString() (converts to UTC). If the TZ is past UTC it subtracts the offset, so the resulting string is the previous day. PATCH: format the string with momentjs so the time zone isn't converted. Signed-off-by: Dan Briem --- Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e33933acb3..aa98a3f853 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 @@ -1063,7 +1063,7 @@ angular.module('egCoreMod') patron.expire_date(patron.expire_date().toISOString()); patron.profile(patron.profile().id()); if (patron.dob()) - patron.dob(patron.dob().toISOString().replace(/T.*/,'')); + patron.dob(moment(patron.dob()).format('YYYY-MM-DD')); if (patron.ident_type()) patron.ident_type(patron.ident_type().id()); if (patron.net_access_level()) -- 2.17.1