【问题标题】:Disable past date code in jquery is not working?在 jquery 中禁用过去的日期代码不起作用?
【发布时间】:2017-07-07 19:23:38
【问题描述】:

我在我的页面中链接了 jquery 文件,该文件可以简单地显示 datepicker,但具有禁用过去日期代码的功能不起作用。当我显示特定日期的代码也不起作用时。反馈将不胜感激。

<script>
   $("#datepicker").datepicker();

   $(document).ready(function(){
        $("#datepicker").datepicker({
            minDate: -0
        });
    });       
</script>

【问题讨论】:

标签: javascript jquery jquery-ui


【解决方案1】:

你可以设置minDate: 0

<script>    
   $(document).ready(function(){
        $("#datepicker").datepicker({
            minDate: 0
        });
    });       
</script>

【讨论】:

    猜你喜欢
    • 2017-10-15
    • 1970-01-01
    • 2012-01-11
    • 1970-01-01
    • 2022-01-18
    • 1970-01-01
    • 2015-08-09
    • 1970-01-01
    • 2019-11-29
    相关资源
    最近更新 更多