jQuery datepicker-如何更改& quot; today& quot;日期? [英] jQuery datepicker - How to change "today" date?

查看:39
本文介绍了jQuery datepicker-如何更改& quot; today& quot;日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以更改jquery.ui datepicker中的今天"日期?今天,我的意思是今天(class ="ui-datepicker-today"),而不是minDate或当前选择的日期!

Is there a way to change the "today" date in jquery.ui datepicker? With today, I mean today (class="ui-datepicker-today") and not the minDate or the current-selected date!

我发现,日期选择器使用系统时间作为默认值.现在,我从服务器获取当前日期,并将其设置为我的minDate.但是我没有找到设定今天日期的方法...它仍然使用我的系统日期(那里有一些用户的系统日期在2000年或更早之前).

I figured out, that datepicker uses the system time for default values. Now I get the current date from my server and set it to my minDate. But I didn't find a way to set the today-date... It still uses my system date (there are some users out there whose systemdate is in the year 2000 or earlier).

可以帮我吗?

推荐答案

基于这始终是用户的系统日期.

That is always going to be the user's system date.

如果绝对必须解决此问题,请向下看一行;您可以覆盖 $.datepicker._daylightSavingAdjust 并从服务器中返回日期*

If you absolutely must fix this, look down a line; you could override $.datepicker._daylightSavingAdjust and return the date from your server *

但这是一个坏主意.为什么您的用户的系统日期如此混乱?为什么是你的问题?如果他们抱怨,告诉他们修理时钟.

But this is a bad idea. Why on earth do your users have their system date so messed up? Why is that your problem? If they complain, tell them to fix their clocks.

*我不能强调这个想法有多糟糕.该函数用于对日期选择器中的大多数日期进行规范化,因此您必须编写一些复杂的逻辑,以免弄乱所有内容.那甚至可能不可行.

* I can't emphasize how bad an idea this is. That function is used to normalize most of the dates in the datepicker, so you'll have to write some pretty convoluted logic to keep from messing everything up. That may not even be feasible.

这篇关于jQuery datepicker-如何更改& quot; today& quot;日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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