New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Locale for date and time #1703
Comments
I'm not a massive fan of sticking it inside Espruino itself, because it's a lot of extra bulk when templated strings let you do format date reasonably easily. It's kind of annoying that Date.toLocaleFormat isn't a standard, as I'd be totally behind putting something like that in. Looking at the MDN docs there's a standard for |
Completely agreed, do not blow up the firmware with locale. Will check for tiny js lib. There is a nice lib from @allObjects in the forum, will check this too. |
From the forum: Date().toDateString() |
Ok, locale is now available as Bangle.js app. How could this be available for all other devices as well?
|
Maybe make this same code use UART.js to allow an upload to any Espruino device? https://github.com/espruino/EspruinoWebTools/blob/master/uart.js We could add it to the Espruino site in a similar way to the Image Converter |
I like that idea, pick a language and get something like this:
|
Yes - it could even write it automatically if needed. |
Closing this - now implemented for Bangle.js |
Well, would be nice to have locale for all other devices too. |
Maybe as function in the WebIDE |
Yes, that sounds like a good idea. |
What about date and time in locale specific formats?
Not as part of firmware but as part of user javascript code.
Espruino/src/jswrap_date.c
Lines 29 to 30 in 449b1f8
Maybe assign lookup array for day and month names from customer code to a time format translation function in the firmware. (add prototype function to Date).
The text was updated successfully, but these errors were encountered: