isPseudoHighlighted()

in src/datepicker/day.tsx [272:315]


  isPseudoHighlighted() {
    const date = this.getDateProp();
    const { value, highlightedDate } = this.props;

    if (Array.isArray(value)) {
      const [start, end] = value;

      if (!start && !end) {
        return false;
      }

      if (highlightedDate && start && !end) {
        if (this.dateHelpers.isAfter(highlightedDate, start)) {
          return this.dateHelpers.isDayInRange(
            this.clampToDayStart(date),
            this.clampToDayStart(start),
            this.clampToDayStart(highlightedDate)
          );
        } else {
          return this.dateHelpers.isDayInRange(
            this.clampToDayStart(date),
            this.clampToDayStart(highlightedDate),
            this.clampToDayStart(start)
          );
        }
      }

      if (highlightedDate && !start && end) {
        if (this.dateHelpers.isAfter(highlightedDate, end)) {
          return this.dateHelpers.isDayInRange(
            this.clampToDayStart(date),
            this.clampToDayStart(end),
            this.clampToDayStart(highlightedDate)
          );
        } else {
          return this.dateHelpers.isDayInRange(
            this.clampToDayStart(date),
            this.clampToDayStart(highlightedDate),
            this.clampToDayStart(end)
          );
        }
      }
    }
  }