amsul / amsul/pickadate.js

Daylight savings time affecting date unix timestamp value

未關閉
#823 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
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 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。