Hi, There,
I'm trying to combine the isSame ( moment.js method ) & isDayHighlighted,
but some weird things happend.
when i use "Array" into isSame, it's works fine :
( the format of Array must be [YYYY, MM, DD] )
isDayHighlighted : day => day.isSame( [2017, 8, 30], 'day' )
when i use "String" into isSame, but it's not working :
( the format of String must be 'YYYY-MM-DD' )
isDayHighlighted : day => day.isSame( '2017-8-30' , 'day' )
either way is return true,
but the "String" way isn't working.
Does anyone knows why?
PS : isSame docs : http://momentjs.com/docs/#/query/is-same/
Thanks for help. ^^
These seems like more of a moment question than a react-dates question, so I'm going to close this issue.
Um, in general, I'd recommend using the exported isSameDay method from this repo as its a bit more performant.
This example will highlight today's date on the calendar:
const now = moment()
...
<SingleDatePicker
isDayHighlighted={ day => day.isSame( now, 'd' ) }
...
/>
Most helpful comment
This example will highlight today's date on the calendar: