Skip to content
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

Navigation bug: skipping a week when trying to switch to the previous week. #1406

Open
Pavel2906 opened this issue Nov 3, 2023 · 1 comment

Comments

@Pavel2906
Copy link

Pavel2906 commented Nov 3, 2023

Description
I use the calendar in the "weekly" view and "first-day-of-week"=2, when I try to switch to the previous week - the transition is carried out immediately two weeks ago.

Example
The number of the current week is 45, and as soon as I click on the navigation arrow (go back) I will switch to week 43 (expected result -> week 44). I tried to change the calendar configuration, but I didn't get the expected result. How can I solve this problem?

Initial state
image

State after clicking on the navigation arrow (go back)
image (1)

My config:
<VCalendar ref="calendar" locale="en" view="weekly" transparent borderless title-position="left" :first-day-of-week="2" expanded show-weeknumbers />
It may be useful, if you set "first-day-of-week"=1, the navigation will work correctly.

@donkeeman
Copy link

donkeeman commented Nov 28, 2023

I have similar issue.
In my case, if this week is the last week of this month and the first week of next month (like above pictures), prev button works fine, but when I click next button same week shows twice.

const date = ref(new Date('2023-11-28'))
const calendarRef = ref(null)

<Calendar
  view="weekly"
  :first-day-of-week="7" // other numbers work fine
  ref="calendarRef"
  v-model="date"
  mode="date"
  expanded
/>

At first, calendarRef.value.pages[0].id is "2023-11-w5", and after clicking next button,calendarRef.value.pages[0].id is "2023-12-w1", but calendarRef.value.pages[0].viewDays is same as before, so the week shows twice.
So I think the combination of specific week(the last week of current month and also the first week of next month) (or specific day) and specific first-of-day-week might cause navigation issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants