smart-mirror icon indicating copy to clipboard operation
smart-mirror copied to clipboard

Trouble changing time and date to european formats

Open SenadM opened this issue 10 years ago • 5 comments

Tried to change the language in the config file to en-GB. Hasn't worked. This includes the date and time of the mirror (24h and DD/MM/YYYY)

SenadM avatar Aug 22 '16 18:08 SenadM

Looks like there is a bug in the controller when registering locals for moment: https://github.com/evancohen/smart-mirror/blob/dev/js/controller.js#L44

This is an issue with moment as they don't support an alias between the fully qualified locale and the locale that they provide, ie: French is fr while UK English is en-gb. That makes things complicated for us, because we always need the fully qualified locale for speech recognition.

There's proudly a simple work-around here, I'll take a look tonight.

evancohen avatar Aug 22 '16 21:08 evancohen

Great Evan, thanks. I made it work with some workarounds, so now, I have the Danish date and time format. Had trouble with the weather and traffic info because I changed the language to "da", but ended up fixing it for now.

SenadM avatar Aug 22 '16 22:08 SenadM

Yeah, it's complicated because each service that needs the language wants it in a slightly different format.

evancohen avatar Aug 23 '16 20:08 evancohen

I now have a solution to this issue (after totally dropping the ball on it) 🏀. We'll need to create fully qualified alias for each of the moment locales by extending the existing ones: http://momentjs.com/docs/#/customization/

Shouldn't be difficult at all!

evancohen avatar Sep 13 '16 21:09 evancohen

Fixed in dev :)

evancohen avatar Jan 08 '17 05:01 evancohen