-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Time slot labels start at 24:00 instead of 00:00 in Chrome with "hour12:false" #5303
Comments
After further testing, this issue exists in chrome but not firefox |
The issue exists in both 12 hour mode and 24 hour mode.
In my view, 12:00am and 24:00 should only be used to signify the END of a day - they are analogous to 00:00 in the following day.
|
Thanks, confirmed. Another way to get 24 hour format is to set the https://codepen.io/acerix/pen/poJLJyb?editors=0010 Or you could use a plugin like moment.js for more control over the format. |
this behavior is dependent on the locale. as @acerix mentioned, set your locale to one that has this behavior, like 'en-gb' |
Use of |
Using "en-GB" as locale changed the format of how days(column header) are displayed in weekly view i.e they are displayed as ddd D/M (Mon 28/2) but i need it to be of format ddd M/D (Mon 2/22) |
How to solve this problem when I want to set the local to zh-cn? |
This is really weird issue. I tried to fix this issue using By thy way, @rishavjain25, you can fix the day format by adding
|
On v5 you can do this: slotLabelFormat={[ |
Workaround is to customize the timeslot label: const MID_NIGHT = '24:00'; const TimelineLabelContent = ({ timeFormat, date }: { timeFormat: TimelineTimeFormat, date: Date }) => { export const shortTimeOf = ( |
If you tap into the slot render hook for the label content, you can overwrite the text value before it is rendered:
|
|
I think this is the good solution without any condition
|
Thanks for the codepen 👌🏼
|
When the calendar is in timeGridWeek and the slotLabelFormat has 'hour12:false' the first slot is now 24:00 instead of 00:00.
https://codepen.io/spatertot/pen/ExjQJLN?editors=0010
The text was updated successfully, but these errors were encountered: