vuetify icon indicating copy to clipboard operation
vuetify copied to clipboard

[Bug Report][3.11.2] Calendar functions not working beyond midnight

Open Joebayld opened this issue 1 month ago • 2 comments

Environment

Vuetify Version: 3.11.2 Vue Version: 3.6.0-alpha.6 OS: macOS 10.15.7 (current)

Steps to reproduce

  1. Open the playground
  2. Scroll with the minutes slider
  3. Once you pass midnight, the view scrolls back to the top

Expected Behavior

When calling timeToY or scrollToTime, it should calculate the position based on any offsets of the day and allow scrolling beyond midnight.

Actual Behavior

On a calendar day view that goes beyond midnight, the timeToY or scrollToTime functions default to zero.

Reproduction Link

https://play.vuetifyjs.com/#...

Images

Joebayld avatar Dec 06 '25 14:12 Joebayld

I had the same problem. For now I am using:

<v-calendar
  ref="calendar"
  :model-value="currentDate"
  :type="calendarType"
  :events="events"
  :weekdays="[0, 1, 2, 3, 4, 5, 6]"
  :interval-minutes="intervalMinutes"
  :interval-height="48"
  :first-time="firstTime"
/>
const scrollToTimeWorkaround = (timeString?: string) => {
  if (!lastEventime) return;
  if (!calendar.value || calendarType.value !== "day") {
    return;
  }
  const offset = timeToMinutes(firstTime.value) * 60;
  nextTick(() => {
    const time = timeToMinutes(timeString!);
    const first = Math.max(0, time - (time % 30) - 30) + offset;
    calendar.value?.scrollToTime(first);
    lastEventime = null;
  });
//...

const timeToMinutes = (time: string): number => {
  if (!time) return 0;
  const [h = 0, m = 0] = time.split(":").map(Number);
  return h * 60 + m;
};

joweste avatar Dec 10 '25 01:12 joweste

Yeah I've found a similar workaround by adding time to the scroll date. For example to get 1am I have to enter 25 for the hour. Hopefully in the future this could be resolved.

I need to learn how to pull/dev this repo so I can help and submit pull requests.

Joebayld avatar Dec 10 '25 07:12 Joebayld