BugiDev / react-native-calendar-strip

Easy to use and visually stunning calendar component for React Native.
MIT License
933 stars 325 forks source link

Getting an issue when disabling three future dates from today. #327

Open sk12r opened 2 years ago

sk12r commented 2 years ago

const customDates = [ moment().add(3, "days"), moment().add(2, "days"), moment().add(1, "days"), ]; console.log("Custom Dates", customDates); const disableCustomDt = (current) => { return !customDates.includes(current.format("YYYY-MM-DD")); };

<CalendarStrip scrollable // by default false scrollerPaging={false} // disabling the display of day names showDayName={false} // handling date selection onDateSelected={handleDateSelection} // animation on date selection daySelectionAnimation={{ type: "background", highlightColor: "#03A9F4", }} // properties on date selection highlightDateNumberStyle={{ color: "white" }} // Disabling the left and right arrows leftSelector={[]} rightSelector={[]} style={styles.calendarContainer} dateNumberStyle={styles.dateNumberStyle} calendarHeaderStyle={styles.calendarHeaderStyle} selectedDate={moment()} minDate={moment().subtract(29, "days")} maxDate={moment().add(3, "days")} datesBlacklist = {customDates}

      />