react-multi-date-picker icon indicating copy to clipboard operation
react-multi-date-picker copied to clipboard

how to disable past days

Open loralameh opened this issue 1 year ago • 1 comments

i want to disable past days in calendar

here is my current approach

      mapDays={({ date, isSameDate, today }) => {
              let isBooked = bookedDays.find((x) => isSameDate(date, x));
              if (
                date.year <= today.year &&
                date.month.index <= today.month.index &&
                date.day < today.day
              ) {
                return {
                  disabled: true,
                  style: { color: "#ccc" },
                };
              }
            }}

is there a more optimized way?

loralameh avatar Jul 08 '24 11:07 loralameh