10-25-2017 06:14
10-25-2017 06:14
Is toLocaleString() supported? I got the current locale from user-settings with locale.language and I tried to localise the date with toLocaleString(), but it didn't work.
How is the date localised in the Fitbit-watchfaces?
Answered! Go to the Best Answer.
11-14-2017 13:15
11-14-2017 13:15
Sorry, the device only support ES 5.1 JavaScript, and toLocaleDateString() doesn't support the formatting options in this version.
11-09-2017 11:31
11-09-2017 11:31
I was wondering the same thing. I am able to use toLocaleString() to get commas to appear in my numbers that are greater than 1,000; but date.toLocaleDateString("en-us", { 'weekday': "short" })) and date.toLocaleDateString("en-us", { 'month': "short" }) always returns the date in year-month-day format.
11-12-2017 12:56
11-12-2017 12:56
Any news on this?
We should localise our apps and watchfaces for publication, so, how should this be done, if .toLocaleDateString() is not supported?
My solution is working, but not very elegant...
I haven't found anything about localisation in the documentation, so please help...
11-14-2017 13:15
11-14-2017 13:15
Sorry, the device only support ES 5.1 JavaScript, and toLocaleDateString() doesn't support the formatting options in this version.
11-01-2022 13:22
11-01-2022 13:22
Is there a work-around? I want to display the time in HH:MM but not military time. I can slice off the seconds, but I really want 12-hour time.
11-01-2022 13:57
11-01-2022 13:57
If you've got a Date object, you should be able to use most of the functions listed here.
11-02-2022 03:24
11-02-2022 03:24
I think
hours %= 12
should do what you want.
11-02-2022 10:19
11-02-2022 10:19
Thanks!
Note that if (hours == 12) hours %= 12 returns 0, so
hours = ((hours %= 12) ? 0 : 12);
11-02-2022 10:35
11-02-2022 10:35
Does this work?
I'd have thought
hours = hours === 12 ? hours : hours%12;
11-02-2022 13:40
11-02-2022 13:40
11-02-2022 15:10
11-02-2022 15:10
(hours+11)%12+1
11-02-2022 15:21
11-02-2022 15:21
So midnight isn't 0 but 12 in 12h format? I didn't know that! 🙈😅
11-03-2022 10:18 - edited 11-03-2022 11:45
11-03-2022 10:18 - edited 11-03-2022 11:45
I see now that Versa 2 has a different OS than Versa 3, so i retract my question. Sorry.