[open-ils-commits] [GIT] Evergreen ILS branch master updated. 91be2d61b99f52fd4186f7d7ab606b994b49c6db

Evergreen Git git at git.evergreen-ils.org
Wed Jul 31 11:08:34 EDT 2019


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, master has been updated
       via  91be2d61b99f52fd4186f7d7ab606b994b49c6db (commit)
      from  bb2a65d91c4ad803efd45c2907307b3b3c544813 (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 91be2d61b99f52fd4186f7d7ab606b994b49c6db
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Mon May 6 17:41:31 2019 -0400

    LP#1831784: fix Angular's formatting of DOB field
    
    Otherwise, depending on the local time zone, the date displayed
    could be off a day.
    
    The 'dob' columns are currently the the _only_ database/IDL fields
    that are truly dates, not timestamps, hence the hard-coded exception.
    However, an alternative approach would be to define a new 'date'
    field type in the IDL.
    
    To test
    -------
    [1] Construct an eg-grid (say, on the Angular sandbox page) that retrieves
        patron records. For users in North America, the birth dates are
        likely off by a day.
    [2] Apply the patch and repeat step 1. This time, the birth dates should
        display as entered.
    
    Sponsored-by: MassLNC
    Sponsored-by: Georgia Public Library Service
    Sponsored-by: Indiana State Library
    Sponsored-by: CW MARS
    Sponsored-by: King County Library System
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/eg2/src/app/core/format.service.ts b/Open-ILS/src/eg2/src/app/core/format.service.ts
index b0e8072a53..63aeec66f0 100644
--- a/Open-ILS/src/eg2/src/app/core/format.service.ts
+++ b/Open-ILS/src/eg2/src/app/core/format.service.ts
@@ -116,7 +116,15 @@ export class FormatService {
                 if (params.datePlusTime) {
                     fmt = this.dateTimeFormat || 'short';
                 }
-                return this.datePipe.transform(date, fmt);
+                let tz;
+                if (params.idlField === 'dob') {
+                    // special case: since dob is the only date column that the
+                    // IDL thinks of as a timestamp, the date object comes over
+                    // as a UTC value; apply the correct timezone rather than the
+                    // local one
+                    tz = 'UTC';
+                }
+                return this.datePipe.transform(date, fmt, tz);
 
             case 'money':
                 return this.currencyPipe.transform(value);

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

Summary of changes:
 Open-ILS/src/eg2/src/app/core/format.service.ts | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list