LP1840782 locale/timezone aware date display formatter
authorBill Erickson <berickxx@gmail.com>
Wed, 21 Aug 2019 18:06:03 +0000 (14:06 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 21 Aug 2019 19:26:18 +0000 (15:26 -0400)
commit8b439bb322d68c3a412129a6a0987b17876cf285
tree7b8460cd66e81b6d59e6d0400d0b38c6ab8f4663
parent5473cd383d654ec34f675877c9aa113e6673f819
LP1840782 locale/timezone aware date display formatter

Adds a method to the DateUtil class which can generate a human-friendly,
timezone and locale-aware display value for a date.  It supports canned
date and time formats, following the options described here (see
dateStyle and timeStyle):

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat

Adds a tool to the sandbox for generating date strings based on locale,
time zone, date format, and time format.

As noted in the sandbox page and within the utility code, Firefox
support for canned dateStyle and timeStyle values is pending:

resolution of https://bugzilla.mozilla.org/show_bug.cgi?id=1557718.

In the meantime, the code generates locale-aware "short" date and time
values in Firefox.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/util/date.spec.ts
Open-ILS/src/eg2/src/app/share/util/date.ts
Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html
Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts