Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed disabled date using after and befor #352

Closed
stefensuhat opened this issue May 20, 2017 · 1 comment
Closed

Failed disabled date using after and befor #352

stefensuhat opened this issue May 20, 2017 · 1 comment

Comments

@stefensuhat
Copy link

stefensuhat commented May 20, 2017

<DayPickerInput
  localeUtils={ LocaleUtils }
  locale="id"
  type="text"
  name="birthday"
  placeholder="DD/MM/YYYY"
  format="DD/MM/YYYY"
  onDayChange={this.handleBirthdayChange}
  dayPickerProps={{
      enableOutsideDays: false,
      disabledDays: {
          before: moment().subtract(1, 'months').toDate(),
          after: moment().toDate(),
      },
  }}
/>

I want to disabled date before today - 1 month and after today.

but can't achieve those using disabledDays.

@gpbl
Copy link
Owner

gpbl commented May 20, 2017

See #324: you have to specify an array of two objects instead:

 disabledDays: [
  { before: moment().subtract(1, 'months').toDate() },
  { after: moment().toDate() },
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants