【问题标题】:minDate and maxDate makes jQuery change year malfunctionminDate 和 maxDate 使 jQuery 更改年份故障
【发布时间】:2016-03-16 12:56:04
【问题描述】:

这是我的某个日期字段的代码。如果使用更改年份,我不会得到 mindate 年份。这是为什么?

$(function() {
    $("#d_o_b").datepicker({ 
        changeYear: true,
        minDate: " -54Y",
        maxDate: " -17Y"
    });
});

【问题讨论】:

  • 您使用的是哪个日期选择器插件?
  • 我使用 code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> &
  • 请用实际代码更新您的问题
  • @mplungjan 这是代码!!!
  • 哦,我明白了但是为什么你不清楚地解释你的问题本身???您需要使用 yearRange 选项 yearRange: "-54:-17", jsfiddle.net/vy2sjoe2

标签: jquery calendar jquery-ui-datepicker


【解决方案1】:

通过以下方式解决:

$(function() { 
   $("#d_o_b").datepicker({
      changeMonth:true,
      changeYear:true,
      yearRange: "-54:-17" 
   }); 
 }); `

【讨论】:

    猜你喜欢
    • 2014-11-24
    • 2013-04-22
    • 2014-07-03
    • 1970-01-01
    • 2018-10-30
    • 2013-12-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多