简体   繁体   中英

Bootstrap Date Range Picker disable dates

How do I block the availability of some dates in Date Range Picker?

For example:

['22/07/2016', '26/07/2016', '29/07/2016']

Thank

You can use isInvalidDate function.

For example disable Sundays and Saturdays:

isInvalidDate: function(date) {
  return (date.day() == 0 || date.day() == 6);
}

Or disable specific date:

isInvalidDate: function(date) {
    if (date.format('YYYY-MM-DD') == '2016-08-01') {
        return true; 
    } else {
        return false; 
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM