React-datepicker: t.isSame is not a function

Created on 29 Mar 2017  路  3Comments  路  Source: Hacker0x01/react-datepicker

I'm trying to use react-datepicker with [email protected]. When clicking on a day in the calendar, react-datepicker is croaking with what you see in the following screen shot...

screen shot 2017-03-28 at 7 54 01 pm

Any ideas?

Most helpful comment

Ahhh, I think I may have found a clue: https://github.com/Hacker0x01/react-datepicker/issues/167

The "selected" property must be a Moment.js object--not a regular Javascript date object...

I fixed this myself by setting my "selected" property to a moment() object.

All 3 comments

Ahhh, I think I may have found a clue: https://github.com/Hacker0x01/react-datepicker/issues/167

The "selected" property must be a Moment.js object--not a regular Javascript date object...

I fixed this myself by setting my "selected" property to a moment() object.

+1 for docs reflecting the need to use a moment() object for the "selected" property.

@tamitutor your solution made my day
tnx alot

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jjjss94 picture jjjss94  路  3Comments

hoodsy picture hoodsy  路  3Comments

sarav1234 picture sarav1234  路  3Comments

lclemence picture lclemence  路  3Comments

evolve2k picture evolve2k  路  3Comments