javascript - pickadate.js how to disable every Sunday - Stack Overflow

admin2025-04-20  0

I have a simple calendar set up to via pickadate.js. How can I disable every sunday on the calendar? I noticed it having a disable:[] in place but not sure how to specify a day

$('.datepicker').pickadate({
weekdaysShort: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
showMonthsShort: true
})

I have a simple calendar set up to via pickadate.js. How can I disable every sunday on the calendar? I noticed it having a disable:[] in place but not sure how to specify a day

$('.datepicker').pickadate({
weekdaysShort: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
showMonthsShort: true
})
Share Improve this question edited Oct 4, 2013 at 1:52 Tushar Gupta - curioustushar 57.1k24 gold badges106 silver badges109 bronze badges asked Oct 4, 2013 at 1:50 LynxLynx 1,4825 gold badges35 silver badges63 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

Documents says

//Using integers representing days of the week (from 1 to 7):
$('.datepicker').pickadate({
    disable: [
        1, 4, 7
    ]
})

so if you want to disable sunday then:

 $('.datepicker').pickadate({
     weekdaysShort: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
     showMonthsShort: true,
     disable: [7]
});
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745084967a284086.html

最新回复(0)