Javascript 如何在日期选择器中禁用某些日期
我试图禁用日期选择器中的某些日期,如星期五已关闭,因此我需要从日期选择器中取消星期五Javascript 如何在日期选择器中禁用某些日期,javascript,html,jquery,Javascript,Html,Jquery,我试图禁用日期选择器中的某些日期,如星期五已关闭,因此我需要从日期选择器中取消星期五 <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1">
<!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>
$( function() {
$( "#datepicker" ).datepicker();
} );
</script>
</head>
<body>
<p>Date: <input type="text" id="datepicker"></p>
</body>
jQuery UI日期选择器-默认功能
$(函数(){
$(“#日期选择器”).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>
$( function() {
$( "#datepicker" ).datepicker();
} );
</script>
</head>
<body>
<p>Date: <input type="text" id="datepicker"></p>
</body>
功能禁用星期五(日期){
var day=date.getDay();
如果(天==5){
返回[假,“,”不可用“];
}否则{
返回[真];
}
}
jQuery(函数($){
$('input[name=“chk_date”]”)。日期选择器('option','beforeShowDay',DisableFriday)。日期选择器('refresh');
});代码>
jQuery UI日期选择器-默认功能
$(函数(){
$(“#日期选择器”).datepicker();
} );
日期:
到目前为止您尝试了什么。。。。