我想在引导程序datepicker
之前禁用今天之前的所有日期。我挖了互联网,每个人都有这个解决方案,但为什么它不能在我的代码中工作?bootstrap jquery minDate不工作
<input type="text" id="date"/>
$(window).load(function(){
$('#date').datepicker({
minDate:0
});
});
我想在引导程序datepicker
之前禁用今天之前的所有日期。我挖了互联网,每个人都有这个解决方案,但为什么它不能在我的代码中工作?bootstrap jquery minDate不工作
<input type="text" id="date"/>
$(window).load(function(){
$('#date').datepicker({
minDate:0
});
});
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" rel="Stylesheet"
type="text/css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script language="javascript">
$(document).ready(function() {
$("#txtdate").datepicker({
minDate: 0
});
});
</script>
</head>
<body>
Date :
<input id="txtdate" type="text">
</body>
</html>
试试这个!
/* Apply the right format to the minDate option */
$(document).ready(function() {
$("#txtdate").datepicker({
minDate: new Date('12/12/2016');
});
});
的[的minDate不是在引导日期选择器工作]可能的复制(http://stackoverflow.com/questions/19219713/mindate-not-working-in-bootstrap-datepicker) – ankit
的minDate 0为什么呢?它可能是今天的全日期字符串吗? –
@ankit我甚至尝试了可能的重复你的建议startDate。它仍然不工作! –