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

Disabling single days with before/after #451

Closed
agustinramos opened this Issue Jul 6, 2017 · 1 comment

Comments

2 participants
@agustinramos

agustinramos commented Jul 6, 2017

When I want to leave a single day enabled does not work.
Here is the example.
https://jsfiddle.net/obLk164e/

Thank you

@gpbl gpbl changed the title from DayPicker: disabledDays to Disabling single days with before/after Jul 9, 2017

@gpbl gpbl added this to the v6.0.6 milestone Jul 9, 2017

@gpbl gpbl added the bug:minor label Jul 9, 2017

@gpbl

This comment has been minimized.

Show comment
Hide comment
@gpbl

gpbl Jul 9, 2017

Owner

Thanks for reporting this. I think the expected behavior should happen when you specify before and after as the same day (as they are exclusive). This, however, doesn't work either.

Otherwise, you can pass a function, like this:

import DayPicker, { DateUtils } from 'react-day-picker';

<DayPicker
  initialMonth={new Date(2017, 3)}
  disabledDays={
     day => !DateUtils.isSameDay(day, new Date(2017, 3, 26))
  }
/>
Owner

gpbl commented Jul 9, 2017

Thanks for reporting this. I think the expected behavior should happen when you specify before and after as the same day (as they are exclusive). This, however, doesn't work either.

Otherwise, you can pass a function, like this:

import DayPicker, { DateUtils } from 'react-day-picker';

<DayPicker
  initialMonth={new Date(2017, 3)}
  disabledDays={
     day => !DateUtils.isSameDay(day, new Date(2017, 3, 26))
  }
/>

@gpbl gpbl closed this in 0fb0bbf Jul 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment