【问题标题】:disable specific dates in specific month of every year jquery datepicker in jquery the date should be from database在jquery中禁用每年特定月份的特定日期jquery datepicker日期应该来自数据库
【发布时间】:2017-06-08 17:23:22
【问题描述】:

在 jquery 中使用 datepicker 禁用每年特定月份的特定日期。 日期应该来自数据库。

例如: 禁用每年 8 月 15 日的日期,并且日期 auguest-15th 是从数据库中获取的,格式为字符串。

【问题讨论】:

    标签: jquery jquery-ui datetimepicker


    【解决方案1】:

    用于在日历中禁用所有年份的多个日期,

    用途:

    return [!( (day ==15 && month == 8) ll (day ==2 && month == 10) ll (day ==26 && month == 1) ) , " " ];

    【讨论】:

      【解决方案2】:

      你可以使用 beforeShowDay,例如:

      $("#datepicker").datepicker({
      beforeShowDay: function(date) {
          var day = date.getUTCDate();
          var month = date.getUTCMonth();
          return [(day != 15 ) && (motnh != 8)];
         }
      })​​​​​;​
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-07-31
        • 1970-01-01
        • 1970-01-01
        • 2012-04-02
        • 2010-10-15
        • 1970-01-01
        • 2015-07-31
        相关资源
        最近更新 更多