Open james-s-turner opened 9 years ago
This sounds like a quick win. One for 1.0?
There is a discrepancy between the way the date parsing and date formatting is handled within brjs which causes some problems when parsing dates in some locales. The DateParser uses momentjs, and its bundled localisation config to parse dates in most cases. However the DateFormatter uses the Translator, which in turn uses i18n properties for localisation.
A specific issue this causes is when parsing dates in MMM format in DE locale. Parsing fails because: The formatter formats the month name to "Mär" (from an i18n property) The parser expects the month name to be "Mär." (from the momentjs locale configuration)
There are probably other localisation issues caused by this discrepancy.
The encoding of some of the localised characters is also broken in the moment.js file we are currently using. e.g. German März should be März
I've asked @thanhc to verify whether the encoding issues are specific to the 'thirdparty' bundler or the library itself.
This version splits momentjs into two parts
In many apps they don't need the full set of supplied locales so lots of uneeded code is downloaded. We should probably supply a minimal locales file for English only, then users can create cutdown versions and put that in their app libs.
We have had a Caplin issue raised that the whole of moment is downloaded just to use the date-formatting functions needed for our br.i18n.Translator function. https://jira.caplin.com/browse/PCTLIBRARY-1223 It would be good to not download the whole of moment just to use our i18n