[Bug Report] Can't change time format for event in v-calendar
See original GitHub issueEnvironment
Vuetify Version: 2.0.14 Vue Version: 2.6.10 Browsers: Chrome 76.0.3809.132 OS: Linux x86_64
Steps to reproduce
calendar-with-events.ts … formatTime (withTime: VTimestamp, ampm: boolean): string { const suffix = ampm ? (withTime.hour < 12 ? ‘a’ : ‘p’) : ‘’ const hour = withTime.hour % 12 || 12 const minute = withTime.minute
return minute > 0
? (minute < 10
? `${hour}:0${minute}${suffix}`
: `${hour}:${minute}${suffix}`)
: `${hour}${suffix}`
},
…
but
eventNameFunction (): VNameFunction {
return typeof this.eventName === 'function'
? this.eventName as VNameFunction
: (event, timedEvent) => {
const name = event.input[this.eventName as string] as string
if (event.start.hasTime) {
if (timedEvent) {
const showStart = event.start.hour < 12 && event.end.hour >= 12
const start = this.formatTime(event.start, showStart)
what is "showStart"?
const end = this.formatTime(event.end, true)
why is always "true' here?
return `<strong>${name}</strong><br>${start} - ${end}`
} else {
const time = this.formatTime(event.start, true)
why is always "true' here?
return `<strong>${time}</strong> ${name}`
}
}
return name
}
},
Expected Behavior
I expect 24 hours time format
Actual Behavior
Only 12 hours time format
Reproduction Link
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Wrong time format/zone showing - URGENT -
I have checked time zones as well as events. The settings are good, but afternoon events show up in “pm” style. I need...
Read more >Calendar Entries - Scheduled Time One Hour Later Than Set
Open the Calendar app; Create a new even starting at a particular time; Save the event; Even then appears in calendar exactly one...
Read more >Common Problems with Google Calendar - Zapier Help
If you have start and end times being sent to Google Calendar, but receive this error, it could be because the start time...
Read more >Bug report: date format in web profile doesn't mat...
These will be set only if you accept. You can always review and change your cookie preferences through our cookie settings page. For...
Read more >Personalize your Calendar experience - Microsoft Support
Go to Settings · Theme · Dark mode · Bold event colors · Current time zone · Date and time format · First...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://codepen.io/yasn0st/pen/BaBJJOE there is a reprocution. At “ru” locale timeformat should be “24h”. but “ampm” format hardcoded in calendar-with-events.ts file
It should use the locale set on the v-calendar component , the browser language set is not an option because the page language is not necessarily the browser language, language can come from user login session, user choice, etc