[open-ils-commits] [GIT] Evergreen ILS branch rel_3_0 updated. 055e6441dd15885db9640ed3dc5d6ba8d5352cf3

Evergreen Git git at git.evergreen-ils.org
Thu Jun 14 10:18:16 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_0 has been updated
       via  055e6441dd15885db9640ed3dc5d6ba8d5352cf3 (commit)
      from  c5f0c487ffa9b2c8340bedf76ee9c2a12e2c2675 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 055e6441dd15885db9640ed3dc5d6ba8d5352cf3
Author: Bill Erickson <berickxx at gmail.com>
Date:   Thu May 31 10:58:38 2018 -0400

    LP#1774427 Parse DoB dates as whole dates
    
    Fixes DoB parsing in the browser client patron edit interface by
    creating date objects from a whole YMD date string instead of compiling
    the date as collection of pieces.  Compiling dates from pieces (calling
    setFullYear(), setMonth(), etc.) can have unexpected consequences,
    because a change of month can result in a change of days as well, if the
    number of days in the date object exceeds the capacity of the selected
    month.
    
    For example:
    
    ---
    > d = new Date()
    2018-05-31T14:59:26.186Z
    > d.setMonth(1)
    1520092766186
    > d
    2018-03-03T15:59:26.186Z
    --
    
    Parsing as Date(YYYY,MM,DD) instead avoids this kind of shuffling.
    
    To test
    
    [1] Log in to the staff client on the 31st day of the month :)
    [2] Change a patron's DoB to a month that does not contain 31 days.
    [3] Save patron and note on reload, the DoB shows the wrong value.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Terran McCanna <tmccanna at georgialibraries.org>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

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 0e17b39..a504861 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
@@ -752,11 +752,7 @@ angular.module('egCoreMod')
     service.parse_dob = function(dob) {
         if (!dob) return null;
         var parts = dob.split('-');
-        var d = new Date(); // always local time zone, yay.
-        d.setFullYear(parts[0]);
-        d.setMonth(parts[1] - 1);
-        d.setDate(parts[2]);
-        return d;
+        return new Date(parts[0], parts[1] - 1, parts[2])
     }
 
     service.copy_stage_data = function(user) {

-----------------------------------------------------------------------

Summary of changes:
 .../web/js/ui/default/staff/circ/patron/regctl.js  |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list