Read the statement by Michael Teeuw here.
Calendar times in 24 hour format?
-
@MrEdOne said in Calendar times in 24 hour format?:
but when i change to 24, PM disappear.
That makes perfect sense. 24 hour format would NOT show AM/PM, only 12 hour format would do that.
3:00 PM in 12 hour format
1500 in 24 hour format (no PM)
-
Yes, but it won’t change 03:00 to 15:00
-
Oh ok, that’s different
It sounds like something is overriding the timeFormat: setting. Have you made any changes to the calendar.js file?
-
Nope. A search only where is a timeformat in js but my knowledge is to small. :)
-
Are you typing
timeformat
? That won’t work.It has to be
timeFormat
with a capitalF
.Wait a minute, the only options for
timeFormat
in the calendar module areabsolute
orrelative
-
But it not change anything.
With absolute and relative is the same. -
It has to be
timeFormat
with a capitalF
. And at the top of your config also/* Magic Mirror Config * * By Michael Teeuw http://michaelteeuw.nl * MIT Licensed. */ var config = { port: 8080, language: 'en', timeFormat: 24, units: 'metric',
-
Yes. I have everywhere timeFormat. on a top of config and in calendar module with capital F
-
I give up. I don’t know where is error.
-
@MrEdOne
timeFormat
uses the formatting of your operating system.
When “24” is configured the format “hh:mm” is returned. Which is exactly, what you are looking for.
Here is the code snippet from calender.js:switch (config.timeFormat) { case 12: { moment.updateLocale(config.language, { longDateFormat: { LT: "h:mm A" } }); break; } case 24: { moment.updateLocale(config.language, { longDateFormat: { LT: "hh:mm" } }); break; }
What do you get, when typing
date
in your console?
If it’s not in displayed in a format of 24h, change the setting of your OS.Maybe this helps?