|
322 | 322 | const optionsDatePickerCustomFormats1 = {
|
323 | 323 | locale: 'en-US',
|
324 | 324 | date: new Date(2022, 8, 3),
|
325 |
| - inputDateFormat: date => dayjs(date).format('MMMM DD, YYYY'), |
326 |
| - inputDateParse: date => dayjs(date, 'MMMM DD, YYYY').toDate() |
| 325 | + inputDateFormat: date => dayjs(date).locale('en').format('MMMM DD, YYYY'), |
| 326 | + inputDateParse: date => dayjs(date, 'MMMM DD, YYYY', 'en').toDate() |
327 | 327 | }
|
328 | 328 |
|
329 | 329 | new coreui.DatePicker(myDatePickerCustomFormats1, optionsDatePickerCustomFormats1)
|
|
338 | 338 | const optionsDatePickerCustomFormats2 = {
|
339 | 339 | locale: 'es-ES',
|
340 | 340 | date: new Date(2022, 8, 3),
|
341 |
| - inputDateFormat: date => dayjs(date).format('YYYY MMMM DD'), |
342 |
| - inputDateParse: date => dayjs(date, 'YYYY MMMM DD').toDate() |
| 341 | + inputDateFormat: date => dayjs(date).locale('es').format('YYYY MMMM DD'), |
| 342 | + inputDateParse: date => dayjs(date, 'YYYY MMMM DD', 'es').toDate() |
343 | 343 | }
|
344 | 344 |
|
345 | 345 | new coreui.DatePicker(myDatePickerCustomFormats2, optionsDatePickerCustomFormats2)
|
|
379 | 379 | locale: 'en-US',
|
380 | 380 | startDate: new Date(2022, 8, 3),
|
381 | 381 | endDate: new Date(2022, 8, 17),
|
382 |
| - inputDateFormat: date => dayjs(date).format('MMMM DD, YYYY'), |
383 |
| - inputDateParse: date => dayjs(date, 'MMMM DD, YYYY').toDate() |
| 382 | + inputDateFormat: date => dayjs(date).locale('en').format('MMMM DD, YYYY'), |
| 383 | + inputDateParse: date => dayjs(date, 'MMMM DD, YYYY', 'en').toDate() |
384 | 384 | }
|
385 | 385 |
|
386 | 386 | new coreui.DateRangePicker(myDateRangePickerCustomFormats1, optionsDateRangePickerCustomFormats1)
|
|
396 | 396 | locale: 'es-ES',
|
397 | 397 | startDate: new Date(2022, 8, 3),
|
398 | 398 | endDate: new Date(2022, 8, 17),
|
399 |
| - inputDateFormat: date => dayjs(date).format('YYYY MMMM DD'), |
400 |
| - inputDateParse: date => dayjs(date, 'YYYY MMMM DD').toDate() |
| 399 | + inputDateFormat: date => dayjs(date).locale('es').format('YYYY MMMM DD'), |
| 400 | + inputDateParse: date => dayjs(date, 'YYYY MMMM DD', 'es').toDate() |
401 | 401 | }
|
402 | 402 |
|
403 | 403 | new coreui.DateRangePicker(myDateRangePickerCustomFormats2, optionsDateRangePickerCustomFormats2)
|
|
0 commit comments