如何设置jQuery日期选择器的年份范围:1900至当前年份,或1900至9999 [英] How can i set Year range for a jQuery Date Picker: 1900 to current year, or 1900 to 9999

查看:307
本文介绍了如何设置jQuery日期选择器的年份范围:1900至当前年份,或1900至9999的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我使用的Jquery Date picker对我来说足够好了.但是我有一个小问题,即我想将Start year1900End year设置为Current Year9999.

Hi all i used the Jquery Date picker which works well enough for me. But i am having a small issue i.e i would like to set the Start year from 1900 and End year to Current Year or 9999..

在脚本中,我找到了year range

yearRange: 'c-100:c+100'

如果我前进到类似1800之类的东西,我将看不到current year.我应该在这里进行哪些更改,以便以这样的方式查看我的岁月,即年份应为1900-current year1900-9999

If i move forward to some thing like 1800 i am unable to see the current year.. What changes should i do here in order to see my years in a such a way that the years should be 1900-current year or 1900-9999

我尝试了对我有用的方法,但是由于在日历加载时它正在加载,因此在我的应用程序运行时会花费很多时间

I tried this which works for me but as it is loading when the calendar loads it taking much time when my application runs

 datepick({yearRange: '1900:9999'});

根据我的要求,有什么比这更好的选择了

So any better option than this to achieve as per my requirement

推荐答案

尝试一下:

datepick({yearRange: '1900:' + new Date().getFullYear()});

这篇关于如何设置jQuery日期选择器的年份范围:1900至当前年份,或1900至9999的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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