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

minDate / maxDate dates bug? #134

Closed
nanotime opened this issue Aug 7, 2017 · 11 comments
Closed

minDate / maxDate dates bug? #134

nanotime opened this issue Aug 7, 2017 · 11 comments

Comments

@nanotime
Copy link

nanotime commented Aug 7, 2017

I worked with react-bootstrap-date-picker in the pasts and never have a problem.

I'm passing to the <DatePicker /> component the minDate maxDate props (like always) and, well, im getting this error:

Uncaught TypeError: Cannot read property 'slice' of undefined

The dates are strings, ISO strings to be precise:

minDate: 2017-06-01T00:00:00.000Z
maxDate: 2017-06-30T00:00:00.000Z

And the code:

<DatePicker
  minDate='2017-06-01T00:00:00.000Z'
  maxDate='2017-06-30T00:00:00.000Z'
/>

Any idea? This never happened before.

@charrison-symfact
Copy link

I'm getting this too.

@psudeepta
Copy link

even I'm getting.

@SergeyZubkov
Copy link

SergeyZubkov commented Aug 14, 2017

need set defalut value in input - ISOString format

@flygis
Copy link

flygis commented Aug 24, 2017

Im getting the same error here, here is my component:

<DatePicker
dateFormat='DD.MM.YYYY'
defaultValue={new Date().toISOString()}
minDate={new Date().toISOString()}
onChange={nextProps.handleReturnDateChange}
showClearButton={false}
weekStartsOn={1}>

@travellingprog
Copy link
Contributor

I've made a branch in my fork that fixes this. You can install it in your package.json, or you can install this branch, which also includes another min/maxDate-related bug fix, described in PR #131.

For example, I use Yarn, so I was able to get both those fixes in my app by running:

# remove current version
yarn remove react-bootstrap-date-picker

# install branch with fixes
yarn add "https://github.com/travellingprog/react-bootstrap-date-picker#fix-makeDateValue-bug"

@marcuxyz
Copy link

Did you make a pr? @travellingprog

@travellingprog
Copy link
Contributor

@marcusmann yeah, it's PR #137

@JonShort
Copy link
Contributor

I've merged PR #137 - so this bug should be fixed now 👍

@glennWerner
Copy link

I'm using the latest version and I am still getting this error when trying to set minDate.

@seangarita
Copy link

@glennWerner It's because of this month old issue: #139 . Unclear why the package has not been able to be updated.

@wehriam
Copy link
Contributor

wehriam commented Oct 23, 2017

@glennWerner and @seangarita this is a community supported project. We've done our best to share this code but are not always available to review and release updates.

If you're interested in professional support feel free to contact me directly.

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