Note |
---|
Please note that this document is a draft and still not finalized. |
Info |
This page describes how the Date and Time localization is handled in BRP web and mobile applications.Mobility |
Table of Contents | ||||
---|---|---|---|---|
|
...
Implementation of Date and Time Localization
...
Date and Time Localization of a website or a mobile app requires require taking into account different formats for date and time. These formats vary, depending on your target country. To ensure that the users can easily understand the website or mobile app, it is important to show the content in their familiar date and time formatting styles.
...
Use of Libraries
In software development, there are a numerous technologies, languages, and frameworks that we can use to implement date and time localization. Considering the nature of the project’s requirements, Moment.js has been selected for the implementation.
Moment.js
Moment.JS is a JavaScript library which helps is parsing, validating, manipulating and displaying date/time in JavaScript easily.
...
As of the reasons for selecting Moment.js, following points are noticeable,
Browser support - Moment works well on Internet Explorer 8 and higher.
Dependency to other libraries - Several other libraries, especially date pickers and graphing libraries, take Moment as a dependency. If such a component is already used and cannot find an alternative, then Moment is already included in the project. Thus, it might make sense to continue using Moment throughout your project rather than including another date and time library.
Familiarity - Already understand its API and limitations well.
Date and Time localization related implementation
In the code level, we are parsing the ‘Locale’ to the moment.locale() function to detect the app specific locale and apply moment().format() function to configure the date and time formats.
...
Example : For Sweden, moment.lang("se").format('L');
Limitations
Here, the implementation doesn’t support the date localization based on the ‘Regions’. Only the basic language will be selected.
Example : English (New Zealand), English (Canada), English (India)
...
In the web app, in the class info cards, it has been decided to show the time in 24-hour format irrespective of the format in the locale considering the spacing issues that might arise.
...
Displayed time zone
(TP56141/GA2024.32)
In BRP Configuration > Apps > Select your app > “Base Information' tab, there is a field Displayed time zone which determines the time zone of the displayed times in the app and web for group activities & services.
...
Example of the use of this:
If the 'Displayed time zone' field is left empty, the time for group activities and services will be shown to users in their current local time zone.
For example, a user in the US will see the activity times in their local US time zone. If the facility where the user made their booking is in Denmark, for instance, they will not see the Danish time but instead their local time zone.If the 'Displayed time zone' is set, the user will see the activity times in the time zone specified in that field. For example, if a user in the US makes a booking at a facility in Denmark, they will see the times in the Danish time zone.
Hiddenfragment macro | ||
---|---|---|
| ||
Limitation The time zone conversion based on the time zone selected in ‘Displayed time zone’ does not apply to event bookings. |