我想禁用日期和星期日和星期六數組..我的日期列表工作完美,但業務邏輯需要禁用星期日和星期六..如何做到這一點?Bootstrap - datesDisabled數組日期和星期日和星期六
這是我的日期陣列碼:
function checkDateFromForEvent() {
var datesForDisable = new Array();
var clientContext = new SP.ClientContext.get_current();
var eventsList = clientContext.get_web().get_lists().getByTitle("Events");
var camlCheckQry = new SP.CamlQuery.createAllItemsQuery();
var items = eventsList.getItems(camlCheckQry);
clientContext.load(items, "Include(EventDate)");
clientContext.executeQueryAsync(successHandler, errorHandler);
function successHandler() {
if (items.get_count() > 0) {
var iEnum = items.getEnumerator();
while (iEnum.moveNext()) {
var item = iEnum.get_current();
datesForDisable.push(moment(item.get_item("EventDate")).format("DD-MM-YYYY"))
}
}
$("#holidayDateFrom").datepicker({
format: 'dd/mm/yyyy',
autoclose: true,
language: 'bg',
weekStart: 1,
calendarWeeks: true,
todayHighlight: true,
datesDisabled: datesForDisable
})
我想在datesDisable paremeter,週日和週六插入..
您能插入我的數組作爲函數中的參數,並foreach每個元素? –
函數(datesForDisable) –
我有多個日期,我需要檢查..... –