gpbl Github contribution chart
gpbl Github Stats
gpbl Most Used Languages

Activity

29 Sep 2022

Issue Comment

Gpbl

Bug: Not handling both "before" and "after" properties in "disabled" field

Bug description

When using both the before and after properties on the disabled object, no days are disabled.

To reproduce

Example here - https://codesandbox.io/s/react-daypicker-forked-m1mr4c?file=/src/App.tsx This should disable anything before 5 days before today, and disable anything after today. Instead, nothing is disabled. If you comment out the before line, it disables using the after property properly. And visa versa.

 <DayPicker
        mode="day"
        selected={range}
        onSelect={setRange}
        disabled={{
          before: new Date(new Date().getTime() - 10 * 24 * 60 * 60 * 1000),
          after: new Date()
        }}
        numberOfMonths={2}
        weekStartsOn={1}
        min={7}
      /> 

Expected behavior

The correct days should be disabled

Screenshots

Screen Shot 2022-09-27 at 3 24 03 PM

Forked On 29 Sep 2022 at 05:02:04

Gpbl

It seems that DateInterval is not handled correctly in isMatch:

https://github.com/gpbl/react-day-picker/blob/5b9f24b7abbcab507c73f619d2446a671505d680/packages/react-day-picker/src/contexts/Modifiers/utils/isMatch.ts#L60-L64

I agree it is confusing. As alternative:

disabled={[
  { after: new Date() },
  { before: new Date(new Date().getTime() - 10 * 24 * 60 * 60 * 1000) }
]}
} 

codesandbox

Commented On 29 Sep 2022 at 05:02:04

Gpbl

website: fix build

Pushed On 26 Sep 2022 at 11:00:56

Gpbl

chore: downgrade node-resolve

Pushed On 26 Sep 2022 at 10:14:23

Gpbl

workspace: update build tasks

Pushed On 26 Sep 2022 at 09:40:27

Gpbl

Revert "chore: add new Components type (#1563)"

This reverts commit 9960123799f09ad01566de6bb46994c7ac9533fb.

Pushed On 26 Sep 2022 at 09:40:27

Gpbl

chore: upgrade dependencies

Pushed On 26 Sep 2022 at 09:40:27
Create Branch
Gpbl In gpbl/react-day-picker Create Branchv8.3.0

Gpbl

React DayPicker is a customizable date picker component for React, with native TypeScript support.

On 26 Sep 2022 at 12:36:54

Gpbl

Bump v8.3.0

Pushed On 26 Sep 2022 at 12:34:18

Gpbl

fix: disabled modifiers with min/max range selections (#1566)

Pushed On 26 Sep 2022 at 12:30:03

Gpbl

fix: disabled modifiers with min/max range selections

Created On 26 Sep 2022 at 12:30:02

Gpbl

chore: reorganize contexts files

Created On 26 Sep 2022 at 12:16:07

Gpbl

chore: improved CSS focus-visible and disabled styles (#1565)

Pushed On 26 Sep 2022 at 12:09:32

Gpbl

chore: reorganize contexts files (#1564)

Pushed On 26 Sep 2022 at 12:09:32

Gpbl

Merge branch 'master' into gpbl/issue1554

Pushed On 26 Sep 2022 at 12:09:32

Gpbl

chore: reorganize contexts files (#1564)

Pushed On 26 Sep 2022 at 12:08:45

Gpbl

chore: reorganize contexts files

Created On 26 Sep 2022 at 12:08:44

Gpbl

chore: improved CSS focus-visible and disabled styles (#1565)

Pushed On 26 Sep 2022 at 12:00:54

Gpbl

chore: improved CSS focus-visible and disabled styles

Created On 26 Sep 2022 at 12:00:54

Gpbl

chore: improved CSS focus-visible and disabled styles

Created On 25 Sep 2022 at 11:55:33

Gpbl

Update CSS

Pushed On 25 Sep 2022 at 11:50:16

Gpbl

Merge branch 'gpbl/update-css' into gpbl/issue1554

Pushed On 25 Sep 2022 at 11:50:16

Gpbl

Update CSS

Pushed On 25 Sep 2022 at 11:49:55
Create Branch
Gpbl In gpbl/react-day-picker Create Branchgpbl/update-css

Gpbl

React DayPicker is a customizable date picker component for React, with native TypeScript support.

On 25 Sep 2022 at 11:48:01
Create Branch
Gpbl In gpbl/react-day-picker Create Branchgpbl/issue1554

Gpbl

React DayPicker is a customizable date picker component for React, with native TypeScript support.

On 25 Sep 2022 at 11:26:22

Gpbl

Remove dup lines

Pushed On 25 Sep 2022 at 07:31:13

Gpbl

chore: reorganize contexts files

Created On 25 Sep 2022 at 07:23:41
Create Branch
Gpbl In gpbl/react-day-picker Create Branchgpbl/reorganize-contexts

Gpbl

React DayPicker is a customizable date picker component for React, with native TypeScript support.

On 25 Sep 2022 at 07:21:57

Gpbl

fix: infinite recursion when focusing next days (#1549)

  • Fix stack overflow error with infinite or large spans of non-focusable dates. This is done by limiting the recursion of getNextFocus to a default of 30 days.

  • Increase default attemps to 365 days

  • Remove undefined check: it's non-sensical now

  • Restore getNextFocus.test.tsx

  • Restore getNextFocus.tsx

  • Stop recursion for getNextFocus and getInitialFocusTarget

  • Remove recursion check

Co-authored-by: gpbl gpbellavite@icloud.com Co-authored-by: gpbl io@gpbl.dev

Pushed On 25 Sep 2022 at 12:41:57

Gpbl

fix: infinite recursion when focusing next days

Created On 25 Sep 2022 at 12:41:57