如何设置jquery日期选择器的开始年份和结束年份?

问题描述:

当我初始化一个类似jquery的日期选择器时

When I initialize a jquery date picker like

$( "#datepicker" ).datepicker({
    changeMonth: true,
    changeYear: true
});

显示从2000年到2020年的日期选择器.

The showing the date picker from year 2000 to year 2020.

当我进入2000年时,它是1990年的下一次显示,但是我想以任何方式对其进行自定义.

When i go to year 2000, the next time it shows from 1990, but any way I want to customize it.

如何设置适合我要求的年份和年份.

How do I set the from year and to year that will fit for my requirements.

谢谢.

请参见文档:该选项称为 yearRange .

See the documentation: The option is called yearRange.

控制年份下拉列表中显示的年份范围:相对于今天的年份(-nn:+ nn),相对于当前选定的年份(c-nn:c + nn),绝对的(nnnn:nnnn) ),或这些格式的组合(nnnn:-nn).请注意,此选项仅影响下拉菜单中显示的内容,使用minDate和/或maxDate选项来限制可以选择的日期.

Control the range of years displayed in the year drop-down: either relative to today's year (-nn:+nn), relative to the currently selected year (c-nn:c+nn), absolute (nnnn:nnnn), or combinations of these formats (nnnn:-nn). Note that this option only affects what appears in the drop-down, to restrict which dates may be selected use the minDate and/or maxDate options.