-4
有人可以帮助我更改代码,我想让我的成员在3月至10月(每年)之间选择一个星期日。 但仅限本月的第2或第4个周日。JQuery Datepicker
感谢您的帮助!
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript">
$(function() {
$("#datepic").datepicker(
{ beforeShowDay: function(day) {
var day = day.getDay();
if (day == 2 || day == 5| day == 4| day == 6| day == 1| day == 3)
{
return [false, "somecssclass"]
} else {
return [true, "someothercssclass"]
}
}
});
});
</script>
</head>
<body>
<p>Uw voorkeursdatum: <input id="datepic"/>
</body>
</body>
</html>
你应该尝试,并开始开发和提问,如果您有任何问题或看到错误。 –
这个答案应该可以帮助你的方式http://stackoverflow.com/a/9295262/2822450 – developius
我改变了你只能选择星期日,但现在呢?我想只启用每个月的第二个和第四个星期天。 – tiresz