tamble / jquery-ui-daterangepicker

A JQuery UI based date range picker.
MIT License
184 stars 110 forks source link

Problem selecting dates when DST is in use #79

Closed timdr101 closed 7 years ago

timdr101 commented 7 years ago

If I select a date range in the UI of 16/04/2017 to 26/04/2017 and apply var tim = JSON.stringify($("#e7").daterangepicker("getRange")); I get returned {"start":"2017-04-15T23:00:00.000Z","end":"2017-04-25T23:00:00.000Z"}

By looking at the timestamps it looks as though there has been a time adjustment to reflect daylight saving time (In this case returning GMT 23:00 rather than BST 16th at 00:00 - not sure if this is a bug or I am missing a configuration item.

Tim

op16 commented 7 years ago

It's working as intended. Just translate the range to your local timezone, and you get 16th to 26th.

PS. If you don't care about time and timezones, just use the value of the input element: it's {"start":"2017-04-16","end":"2017-04-26"}.

PPS. Z means UTC, not GMT.

op16 commented 7 years ago

Closed as invalid.