CalendarPicker icon indicating copy to clipboard operation
CalendarPicker copied to clipboard

minRangeDuration is defaulting to use the disbaled

Open talon-himself opened this issue 2 years ago • 0 comments

When using minRangeDuration with any value is passing the libraries disabled styles to the text.

Here is my Calendar

<CalendarPicker
  allowBackwardRangeSelect={allowBackwardRangeSelect}
  allowRangeSelection={isDateRange}
  customDayHeaderStyles={customHeaderStyles}
  dayLabelsWrapper={{
    borderBottomWidth: 0,
    borderTopWidth: 0,
  }}
  maxDate={maxDate}
  minRangeDuration={1}
  monthTitleStyle={{
    fontFamily: FontName.CalibreSemibold,
    fontSize: TITLE_FONT_SIZE,
    fontWeight: TITLE_FONT_WEIGHT,
    letterSpacing: 1,
  }}
  nextComponent={<ChevronRightSVG color={theme.colors.neutralStrong} />}
  onDateChange={onDateChange}
  previousComponent={
    <ChevronLeftSVG color={theme.colors.neutralStrong} />
  }
  selectedDayColor={theme.colors.success}
  selectedDayTextColor={
    isDateRange ? theme.colors.basic : theme.colors.background
  }
  selectedEndDate={endDate}
  selectedRangeEndStyle={{
    backgroundColor: theme.colors.success,
  }}
  selectedRangeEndTextStyle={{
    color: theme.colors.background,
  }}
  selectedRangeStartStyle={{
    backgroundColor: theme.colors.success,
  }}
  selectedRangeStartTextStyle={{ color: theme.colors.background }}
  selectedRangeStyle={{
    backgroundColor: theme.colors.successSoft,
  }}
  selectedStartDate={startDate}
  textStyle={{
    textAlign: 'center',
    color: theme.colors.basic,
    fontFamily: FontName.Calibre,
    fontSize: DAY_FONT_SIZE,
    fontWeight: DAY_FONT_WEIGHT,
    lineHeight: 16,
  }}
  todayBackgroundColor={theme.colors.accent}
  todayTextStyle={{ color: theme.colors.basic }}
  weekdays={WEEKDAYS}
  yearTitleStyle={{
    fontFamily: FontName.CalibreSemibold,
    fontSize: TITLE_FONT_SIZE,
    fontWeight: TITLE_FONT_WEIGHT,
    letterSpacing: 1,
  }}
/>

Here is a screenshot when allowBackwardRangeSelect is false image

Here is a screenshot when allowBackwardRangeSelect is true image

As you can see, the startDate is today's date and it is a range, the 19th is getting the disabled styles for some reason. I inspected the styles and it is getting #BBBBBB as the color and I am not using that color value anyhwere in my code. Is it possible that some of my styles are making it default to use disabled?

talon-himself avatar Mar 18 '22 23:03 talon-himself