6eDesign / svelte-calendar

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

"Cannot read property 'weeks' of undefined" - we're past hardcoded end date #98

Closed avimar closed 3 years ago

avimar commented 3 years ago

https://github.com/6eDesign/svelte-calendar/blob/74f04bba36ec11a12a1a12fd91f15d8db4a5f5bb/src/Components/Datepicker.svelte#L17

I just ran into this issue: Cannot read property 'weeks' of undefined

I was not defining an end time, assuming it was open-ended. It's not, it's hardcoded with a date that we're now past.

I'm now using this hacky bit for a 3 month window: start={new Date()} end={new Date(new Date().getTime()+1000*60*60*24*90)}

antony commented 3 years ago

Just noticed this too.

6eDesign commented 3 years ago

Fixed in version 2.0.x - start and end date defaults have been updated to 1 year ago and 1 year in future, respectively.