beyonk-group / svelte-datepicker

A lightweight datepicker written in Svelte
MIT License
141 stars 23 forks source link

Default End Date #43

Open kennedyrose opened 2 years ago

kennedyrose commented 2 years ago

Is there a way to set the default end date that shows up? Or set it programmatically somehow. We have an app where the default end date on the range needs to be set for a day from current day.

t-lock commented 1 year ago

We have the same issue. Unfortunately we didn't realize that this critical functionality was missing until already implementing and theming the range picker.

EDIT: I have submitted a PR which solves this issue: #65

I am not sure if this project is actively being maintained anymore, but if anyone stumbles across this same issue, they can check the code above for a solution. It's a very minimal and simple solution you can implement in your own project: see commit: https://github.com/beyonk-adventures/svelte-datepicker/pull/65/commits/895d635fa43148a7b0d2d5098984a118733aa3e7

If you want, you could even install my fork directly

npm i https://github.com/t-lock/svelte-datepicker.git