Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
Are any date formatting features available in the SDK JavaScript?
EG.
date.toLocaleString('fr-FR', options)
or are there routines to emulate this ?
Author | ch, passion for improvement.
Answered! Go to the Best Answer.
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Unfortunately that's not available on device due to the version of ECMAScript supported by the Javascript engine.
You can see an example of localising dates here, albeit manually. https://github.com/Fitbit/sdk-i18n/tree/master/app
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Unfortunately that's not available on device due to the version of ECMAScript supported by the Javascript engine.
You can see an example of localising dates here, albeit manually. https://github.com/Fitbit/sdk-i18n/tree/master/app
Best Answer
04-07-2022
04:22
- last edited on
07-02-2024
13:03
by
MarreFitbit
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
04-07-2022
04:22
- last edited on
07-02-2024
13:03
by
MarreFitbit
@JonFitbit- thanks, that is useful, however just noticed the setting below returns a language of "en-us".
Is this correct because it will return the wrong date format?
How do you get "en-gb"?
This may be why some English people complain about date format localization because there appears to be no English (UK) setting?
Author | ch, passion for improvement.
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
@JonFitbit - only some language examples are shown in the i18n - is there a complete set of files for all languages?
Author | ch, passion for improvement.
All English language options force the watch the show the date in MM/DD format. Only other languages change it to DD/MM. Will there be a way have the watch in English with DD/MM?
On the watch face I created, I added a Select within the companion App to allow the user to switch between MM/DD and DD/MM. I capture the selection and the watch to react to the changes.
Best AnswerOn my watch faces I build the date display manually as a string concatenated from the individual time/date segments. I know this forces my choice on the user, but I consider it in keeping with the "Convention over Customization" paradigm I learned via Ruby on Rails. Besides, "YYYY-MM-DD" is the only "correct" universal format! 🙂
Best Answer