最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览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]
});
发布评论

评论列表(0)

  1. 暂无评论