Closed niutech closed 6 years ago
Thanks for the report. I also noticed some "strange" behaviour around midnight.
You are referencing to this section:
Would it be an idea to change the (custom) countDays() to using moment.js as well?
Yes, I refer to this line. I think it is a good idea to use moment.js for date diffing, since it it well tested.
Ok, a pull-request would be very welcome
Done, but please test it.
Probably resolved with https://github.com/longbill/jquery-date-range-picker/pull/423, released in https://github.com/longbill/jquery-date-range-picker/releases/tag/0.16.2
In function
checkSelectionValid()
(jquery.daterangepicker.js:1722) the days difference is counted as follows:which does not factor daylight saving time. Instead, it should be:
or using moment.js: