pushtell / react-bootstrap-date-picker

React-Bootstrap based date picker.
MIT License
346 stars 195 forks source link

minDate / maxDate dates bug? #134

Closed nanotime closed 7 years ago

nanotime commented 7 years ago

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 commented 7 years ago

I'm getting this too.

psudeepta commented 7 years ago

even I'm getting.

SergeyZubkov commented 7 years ago

need set defalut value in input - ISOString format

flygis commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

Did you make a pr? @travellingprog

travellingprog commented 7 years ago

@MarcusMann yeah, it's PR #137

JonShort commented 7 years ago

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

glennWerner commented 7 years ago

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

seangarita commented 7 years ago

@glennWerner It's because of this month old issue: https://github.com/pushtell/react-bootstrap-date-picker/issues/139 . Unclear why the package has not been able to be updated.

wehriam commented 7 years ago

@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.