minDate无法在引导日期戳中工作 [英] minDate not working in bootstrap datepicker

查看:101
本文介绍了minDate无法在引导日期戳中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此引导日期戳 http://www.eyecon.ro/bootstrap-datepicker/

I am using this bootstrap datepicker http://www.eyecon.ro/bootstrap-datepicker/:

<script type="text/javascript">
var dateToday = new Date();
$(function() {
    $("#id_deadline").datepicker({minDate: dateToday});
});
</script>

我想选择从今天到未来的日期(不是过去的日期)。日期戳显示,它也让我选择过去的日期。有什么问题?

I want to let select the date from today to future only (not a past date). Datepicker is showing up and it is letting me select the past date too. What's wrong?

推荐答案

尝试使用这种方式:

$("#id_deadline").datepicker({ startDate: "today" });

使用startDate参数不需要Date var。

There is no need a Date var for using startDate parameter.

这篇关于minDate无法在引导日期戳中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆