gpt4 book ai didi

datetimepicker - XDSoft DateTimePicker - 禁用星期日

转载 作者:行者123 更新时间:2023-12-05 09:22:00 32 4
gpt4 key购买 nike

是否可以在 XDSoft DateTimePicker 中禁用所有指定的工作日,例如所有(且仅)星期日?如何做到这一点?

最佳答案

试试这个。

function disabledWeekdays(date) {
var day = date.getDay();
//0 is Sunday, 1 is Monday, 2 is Tuesday , 3 is Wednesday, 4 is Thursday, 5 is Friday and 6 is Saturday
if (day == 1 || day == 2 ||day == 3 ||day == 4 ||day == 5 ||day == 6) {
return [false] ;
} else {
return [true] ;
}
}

$('#datetimepicker').datetimepicker({

beforeShowDay: disabledWeekdays

});

关于datetimepicker - XDSoft DateTimePicker - 禁用星期日,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29400977/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com