onesine / react-tailwindcss-datepicker

Modern date range picker component for React using Tailwind 3 and dayjs. Alternative to Litepie Datepicker.
https://react-tailwindcss-datepicker.vercel.app/
MIT License
505 stars 147 forks source link

How to disable weekends ? #215

Open athimannil opened 7 months ago

athimannil commented 7 months ago

There is option to disable specific dates

<Datepicker
  disabledDates={[
    {
      startDate: "2023-02-02",
      endDate: "2023-02-05",
    },
    {
      startDate: "2023-02-11",
      endDate: "2023-02-12",
    },
  ]}
  startFrom="2023-02-02"
  value={value}
  onChange={handleValueChange}
/> 

Is there option to disable all the weekends (Saturday and Sunday) ?

With like Date.getDay() === 0 || Date.getDay() === 6)