夏令时导致 Firefox 上的 jQuery UI 日期选择器出现问题 [英] Daylight Saving Cause an issue on jQuery UI datepicker on Firefox

查看:22
本文介绍了夏令时导致 Firefox 上的 jQuery UI 日期选择器出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Firefox 上遇到了 jQuery UI 日期选择器的问题.

我正在开发一个基于未来日期时间表的系统,我注意到 2016-03-31 是星期四,这是正确的,但 2016-04-01 也是星期四,应该是星期五!

该问题出现在桌面版和移动版 Firefox 上,但在其他浏览器上没有.

有趣的是,它发生在

2016 年 4 月

如您所见,四月的所有日期都包含错误的星期几.移一天.

如您所见,4 月是错误的,但 3 月和 5 月是正确的.

而且,为了回应下面的评论,是的,我m 在 约旦,亚洲.那么?

解决方案

该问题与我的国家有关,因为:

根据 @Pang 评论,

<块引用>

约旦在 2016 年 4 月 1 日有一些夏令时变更和更改就在 00:00:00!显然,乔丹在 2016-04-01 没有 00:00:00,所以 Firefox 很困惑,认为 00:00:00 仍然是星期四.

而且问题会在 4 月 1 日自动修复:)

I'm having an issue with jQuery UI datepicker on Firefox.

I am working on a system based on schedules for a future date and I noticed that 2016-03-31 is Thursday, which is correct, but 2016-04-01 is also Thursday when it should be Friday!

The issue appeared on both the desktop and mobile version of Firefox, but not on other browsers.

The interesting thing is, it happens in the demos on https://jqueryui.com/datepicker/ too!

Screenshot on https://jqueryui.com/datepicker/ for March 2016:

Screenshot on https://jqueryui.com/datepicker/ for April 2016:

As you can see, all dates on April have the wrong day of week. It is shifted by one day.

Screenshot on https://jqueryui.com/datepicker/#multiple-calendars for March to May 2016:

As you can see, it's wrong in April but correct in March and May.

And, in response to a comment below, yes, I'm in Jordan, Asia. So?

解决方案

The issue is related to my country because:

Per @Pang comments,

Jordan is having some Daylight Saving Time changes on 2016-04-01 and the change is right at 00:00:00! Apparently, Jordan does not have 00:00:00 on 2016-04-01 so Firefox is confused and thinks that 00:00:00 is still Thursday.

And the problem is fixed on the 1st of April automatically :)

这篇关于夏令时导致 Firefox 上的 jQuery UI 日期选择器出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆