6eDesign / svelte-calendar

A lightweight datepicker with neat animations and a unique UX.
https://6edesign.github.io/svelte-calendar/
MIT License
543 stars 90 forks source link

Next month button does not work if the date selection on previous month is greater than today's date #166

Open nixonnix opened 1 year ago

nixonnix commented 1 year ago

Usecase: I am using svelte-calendar with a cap of end date as today.

import { InlineCalendar } from 'svelte-calendar'; <InlineCalendar end={new Date()} />

Output: The next month button on calendar does not work if the date selection on previous month is greater than today's date.

Steps to replicate:

Step 1: Go to previous month. Step 2: Select a date on previous month (say 11 April) with is greater than today's date number (10 May) Step 3: Click on the next button. Step 5: Calendar will not allow you to go to next month. Step 6: Change the date to a lesser date than todays or same date number (say 10th April). Step 7: Click on the next button. Calendar will allow you to got to next date.

Expected: Calendar should allow to go to next date

https://github.com/6eDesign/svelte-calendar/assets/54344612/77d70c21-3e41-4e41-90ef-8664c1795c8b

hellquist413 commented 1 year ago

Same issue here with $store.start = today; using Datepicker but for the previous month. Only way I find to access the month is by clicking on the "grayed out" dates of the next/previous month and it will jump there.