Daylight savings time affecting date unix timestamp value
未關閉
- 主要語言
- JavaScript
- 星號
- 7.6k
- 分支
- 981
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Hi.
I'm currently setting the date value that is selected by users to a data attribute on the input as below.
$ELEMENT.attr("data-selectedDate", P.component.get( 'select' ).pick);
I'm getting a Unix timestamp returned x 1000 however I've noticed if the date that is being set is + / - one hour due to daylight savings, then the timestamp value is set to 23:00 as opposed to 00:00.
This only seems to cause an issue if you are trying to calculate the date range or number of nights from two date pickers where one of the dates are an hour ahead or behind. In this case you will end up with a decimal value in the returned number of nights.
貢獻指南
評估
這個 Issue 還沒有評估資料。