eclipsesource / eclipsesource/tabris-con
Localize dates and times based on the device's locale
- Dominant language
- JavaScript
- Stars
- 10
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
All of the dates in the app are shown with the day preceding the month in the way the majority of the world expresses it. However Americans think this format looks odd and may lead to confusion where both the day and the month are less than 12. Textual labels (e.g. "Jan") could possibly eliminate some of this confusion. Rather than managing the date format in the conference config, the app should instead load the device's locale settings and format dates accordingly which is especially useful for conferences that draw worldwide attendance. This has the added benefit of using the device's time formatting. While 12-hour format is generally acceptable, many programmers--who seem to be the prime audience to the apps that have been deployed thus far--may prefer 24-hour format.
[cordova-plugin-globalization](https://www.npmjs.com/package/cordova-plugin-globalization) offers the [`navigator.globalization.dateToString`](https://github.com/apache/cordova-plugin-globalization#navigatorglobalizationdatetostring) function which is ideally suited to this task. Its only downsides are that it requires round-tripping to the native side and that it is asynchronous (making the calling code unnecessarily complex).
Alternatively, [`navigator.globalization.getDatePattern()`](https://github.com/apache/cordova-plugin-globalization#navigatorglobalizationgetdatepattern) could be loaded once (and stored per session) to avoid the round-tripping to the native side. However this may not be an ideal solution as I have yet to find a JS library that fully conforms to the UTR#35 spec, let alone one that is localized ([fecha](https://www.npmjs.com/package/fecha) was the closest). Additionally, this function has a critical [open issue](https://issues.apache.org/jira/browse/CB-13178).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.