Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Date formats

ANSWERED

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.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

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

View best answer in original post

Best Answer
0 Votes
6 REPLIES 6

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
0 Votes

@JonFitbit- thanks, that is useful, however just noticed the setting below returns a language of "en-us".

 

Guy__0-1649330185254.png

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
0 Votes

@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.

Best Answer

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?

Best Answer

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 Answer
0 Votes

On 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
0 Votes