question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug Report] Can't change time format for event in v-calendar

See original GitHub issue

Environment

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

https://codepen.io/yasn0st/pen/BaBJJOE

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
yasn0stcommented, Sep 6, 2019

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

0reactions
chrmorqmaticcommented, Dec 2, 2019

Well, it should probably generate this time using the browser functionality which takes into account the person’s locale. If they want further customization, they can specify a function for event-name.

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found