react-modern-calendar-datepicker icon indicating copy to clipboard operation
react-modern-calendar-datepicker copied to clipboard

adds a possibility to disable specific week days in every week and forcely enable specific days (opposite of disabledDays)

Open sentisso opened this issue 4 years ago • 3 comments

Examples of changes:

  1. Possibility to disable every monday and saturday or just disable weekends.
  2. Possibility to forcely enable a day, even though it is disabled via disabledDays or disabledWeekDays etc...

Usage:

<DatePicker
    disabledWeekDays={[0,3]} // this will disable every monday and thursday

    // just like disabledDays but it's just the opposite
    enabledDays={[
        { year: 2021, month: 2, day: 18 } // this day will be enabled, even though it is disabled via disabledWeekDays (it's a thursday)
    ]}
/>

disabledWeekDays: Just simply enter a numeric array to disabledWeekDays props. The array should include numeric values from 0 to 6, where 0 means Monday and 6 means Sunday.

enabledDays: Just simply enter an array of Day objects and those days will not be disabled.

sentisso avatar Jan 15 '21 18:01 sentisso

@Kiarash-Z This would also support a highly anticipated feature of enabling specific days (in addition to disabling specific days).

timuster avatar Feb 07 '21 04:02 timuster

Hey @SenTisso it looks like this project is no longer maintained. See #248 I am potentially looking into forking the project.

Thanks, daniel-sudz

daniel-sudz avatar Apr 02 '21 22:04 daniel-sudz

So I created my own fork (duh), but I also published this fork containing these features to npm @sentisso/react-modern-calendar-datepicker, so now you can use them!

sentisso avatar Feb 09 '22 23:02 sentisso