|
228 | 228 | const myCalendarDisabledDates = document.getElementById('myCalendarDisabledDates') |
229 | 229 | if (myCalendarDisabledDates) { |
230 | 230 | const optionsCalendarDisabledDates = { |
231 | | - locale: 'en-US', |
232 | 231 | calendarDate: new Date(2022, 2, 1), |
233 | 232 | calendars: 2, |
234 | 233 | disabledDates: [ |
|
237 | 236 | new Date(2022, 3, 16), |
238 | 237 | [new Date(2022, 4, 2), new Date(2022, 4, 8)] |
239 | 238 | ], |
| 239 | + locale: 'en-US', |
240 | 240 | maxDate: new Date(2022, 5, 0), |
241 | 241 | minDate: new Date(2022, 1, 1) |
242 | 242 | } |
|
245 | 245 | } |
246 | 246 | // js-docs-end calendar-disabled-dates |
247 | 247 |
|
| 248 | + // js-docs-start calendar-disabled-dates2 |
| 249 | + const myCalendarDisabledDates2 = document.getElementById('myCalendarDisabledDates2') |
| 250 | + if (myCalendarDisabledDates2) { |
| 251 | + const disableWeekends = date => { |
| 252 | + const day = date.getDay() |
| 253 | + return day === 0 || day === 6 |
| 254 | + } |
| 255 | + |
| 256 | + const optionsCalendarDisabledDates2 = { |
| 257 | + calendars: 2, |
| 258 | + disabledDates: disableWeekends, |
| 259 | + locale: 'en-US' |
| 260 | + } |
| 261 | + |
| 262 | + new coreui.Calendar(myCalendarDisabledDates2, optionsCalendarDisabledDates2) |
| 263 | + } |
| 264 | + // js-docs-end calendar-disabled-dates2 |
| 265 | + |
| 266 | + // js-docs-start calendar-disabled-dates3 |
| 267 | + const myCalendarDisabledDates3 = document.getElementById('myCalendarDisabledDates3') |
| 268 | + if (myCalendarDisabledDates3) { |
| 269 | + const disableWeekends = date => { |
| 270 | + const day = date.getDay() |
| 271 | + return day === 0 || day === 6 |
| 272 | + } |
| 273 | + |
| 274 | + const specificDates = [ |
| 275 | + new Date(2024, 10, 25), |
| 276 | + new Date(2024, 11, 4), |
| 277 | + new Date(2024, 11, 12) |
| 278 | + ] |
| 279 | + |
| 280 | + const optionsCalendarDisabledDates3 = { |
| 281 | + calendarDate: new Date(2024, 10, 1), |
| 282 | + calendars: 2, |
| 283 | + disabledDates: [disableWeekends, ...specificDates], |
| 284 | + locale: 'en-US' |
| 285 | + } |
| 286 | + |
| 287 | + new coreui.Calendar(myCalendarDisabledDates3, optionsCalendarDisabledDates3) |
| 288 | + } |
| 289 | + // js-docs-end calendar-disabled-dates3 |
| 290 | + |
248 | 291 | // ------------------------------- |
249 | 292 | // Date Pickers |
250 | 293 | // ------------------------------- |
|
270 | 313 | } |
271 | 314 | // js-docs-end date-picker-disabled-dates |
272 | 315 |
|
| 316 | + // js-docs-start date-picker-disabled-dates2 |
| 317 | + const myDatePickerDisabledDates2 = document.getElementById('myDatePickerDisabledDates2') |
| 318 | + if (myDatePickerDisabledDates2) { |
| 319 | + const disableWeekends = date => { |
| 320 | + const day = date.getDay() |
| 321 | + return day === 0 || day === 6 |
| 322 | + } |
| 323 | + |
| 324 | + const optionsDatePickerDisabledDates2 = { |
| 325 | + disabledDates: disableWeekends, |
| 326 | + locale: 'en-US' |
| 327 | + } |
| 328 | + |
| 329 | + new coreui.DateRangePicker(document.getElementById('myDatePickerDisabledDates2'), optionsDatePickerDisabledDates2) |
| 330 | + } |
| 331 | + // js-docs-end date-picker-disabled-dates2 |
| 332 | + |
273 | 333 | // js-docs-start date-picker-custom-formats1 |
274 | 334 | const myDatePickerCustomFormats1 = document.getElementById('myDatePickerCustomFormats1') |
275 | 335 | if (myDatePickerCustomFormats1) { |
|
326 | 386 | } |
327 | 387 | // js-docs-end date-range-picker-disabled-dates |
328 | 388 |
|
| 389 | + // js-docs-start date-range-picker-disabled-dates2 |
| 390 | + const myDateRangePickerDisabledDates2 = document.getElementById('myDateRangePickerDisabledDates2') |
| 391 | + if (myDateRangePickerDisabledDates2) { |
| 392 | + const disableWeekends = date => { |
| 393 | + const day = date.getDay() |
| 394 | + return day === 0 || day === 6 |
| 395 | + } |
| 396 | + |
| 397 | + const optionsDateRangePickerDisabledDates2 = { |
| 398 | + disabledDates: disableWeekends, |
| 399 | + locale: 'en-US' |
| 400 | + } |
| 401 | + |
| 402 | + new coreui.DateRangePicker(document.getElementById('myDateRangePickerDisabledDates2'), optionsDateRangePickerDisabledDates2) |
| 403 | + } |
| 404 | + // js-docs-end date-range-picker-disabled-dates2 |
| 405 | + |
329 | 406 | // js-docs-start date-range-picker-custom-formats1 |
330 | 407 | const myDateRangePickerCustomFormats1 = document.getElementById('myDateRangePickerCustomFormats1') |
331 | 408 | if (myDateRangePickerCustomFormats1) { |
|
0 commit comments