onefinestay / react-daterange-picker

Other
563 stars 208 forks source link

Last date of the month is not selected if it's also the last day of the week. #70

Open mmakarin opened 8 years ago

mmakarin commented 8 years ago

Examples: May 31th, 2014

{
    firstOfWeek: 0
    value: moment.range(moment(1401483600000).startOf("day"), moment(1401483600000).add(2, "days"))
}

November 30th, 2014

{
    firstOfWeek: 1
    value: moment.range(moment(1412024400000).startOf("day"), moment(1412024400000).add(2, "days"))
}

Looking into the code, moment ranges do not overlap in these cases despite month.end.valueOf() == value.start.valueOf(). See moment.range issue

Pull request with a fix is coming soon

code-jorge commented 8 years ago

I've checked and (probably thanks to @mmakarin) this does not happen anymore. So maybe this issue can be closed?