jQuery datepicker years shown

后端 未结 8 1272
一向
一向 2020-12-13 01:51

With the jQuery datepicker, how does one change the year range that is displayed? On the jQuery UI site it says the default is \"10 years before and after the current year

相关标签:
8条回答
  • 2020-12-13 02:00

    au, nz, ie, etc. are the country codes for the countries whose national days are being displayed (Australia, New Zealand, Ireland, ...). As seen in the code, these values are combined with '_day' and passed back to be applied to that day as a CSS style. The corresponding styles are of the form show below, which moves the text for that day out of the way and replaces it with an image of the country's flag.

    .au_day {
      text-indent: -9999px;
      background: #eee url(au.gif) no-repeat center;
    }
    

    The 'false' value that is passed back with the new style indicates that these days may not be selected.

    0 讨论(0)
  • 2020-12-13 02:13

    i think this may work as well

    $(function () {
        $(".DatepickerInputdob").datepicker({
            dateFormat: "d M yy",
            changeMonth: true,
            changeYear: true,
            yearRange: '1900:+0',
            defaultDate: '01 JAN 1900'
        });
    
    0 讨论(0)
提交回复
热议问题