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

[Feature Request] Disable Dates #155

Open The-Real-Thisas opened 2 years ago

The-Real-Thisas commented 2 years ago

This is something I've used with flatpicker but flatpicker does not work on mobile and reverts to the native date picker.

I'm working on a booking application that requires a user to select an available date. Right now the application flow is the user checks the available dates then picks a date from the datepicker. This is less than ideal.

I think it will be incredibly useful as a prop and the moment it is added to svelte-calender I'm going to add it to my project in a heartbeat.

Related Doc: https://flatpickr.js.org/examples/#disabling-specific-dates

Something like this:

{
    disable: ["2025-01-30", "2025-02-21", "2025-03-08", new Date(2025, 4, 9) ],
    dateFormat: "Y-m-d",
}
Geeky-Mechanic commented 2 years ago

Was going to ask about this, I guess i"ll try and do some other validation

hdz-dev commented 2 years ago

please! add this option.