"Date format" formats hours wrong at midnight
Issue #18
resolved
When reaching midnight and you format the time to something like HH-mm, it will tell the time as 24:30 instead of 00:30. From 01:00 it will revert back to logical time formatting.
Comments (10)
-
repo owner -
repo owner
-
repo owner - changed status to open
-
reporter
-
repo owner Okay, someone else has a same kind of issue.
I will look at this issue tonight, but i only have about 2 hours to solve it ;)
-
repo owner Between 00:00 and 02:00
-
reporter Thanks for the effort!
-
repo owner Okay, in English, when you request the Hours in a non-12-hour format, you will get 24:xx.
This is the definition for english.
I have change this, because it will mess up what people would want!
Update BLL to resolve this issue!
And let me know if it worksTo see this, try these 2 codes in HomeyScript:
let date = new Date(); date = date.setHours(date.getHours()+5); date = new Date(date); let a = date.toLocaleString('EN' || this.locale || DateTime.locale, {hour:'2-digit', hour12:false }); return a;
will return 24
and thenlet date = new Date(); date = date.setHours(date.getHours()+5); date = new Date(date); let a = date.toLocaleString('EN' || this.locale || DateTime.locale, {hour:'2-digit', hourCycle:'h23' }); return a;
Will return 00
-
repo owner - changed status to resolved
-
reporter It works, thanks!
- Log in to comment
Please send me a prinscreen of the BLL app settings with the Locale in it