You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Parsing dates with a named day of the week fails. However, switching the function to call moment works as expected.
constdayjs=require('dayjs')// Multiple plugins were tested.letweekday=require('dayjs/plugin/weekday')letcustomParseFormat=require('dayjs/plugin/customParseFormat')letlocaleData=require('dayjs/plugin/localeData')letlocalizedFormat=require('dayjs/plugin/localizedFormat')letupdateLocale=require('dayjs/plugin/updateLocale')letutc=require('dayjs/plugin/utc')dayjs.extend(weekday)dayjs.extend(localeData)dayjs.extend(customParseFormat)dayjs.extend(localizedFormat)dayjs.extend(updateLocale)dayjs.extend(utc)// Prints `false`.console.log(dayjs('Wednesday, December 30th 2020 (6:00 pm)','dddd, MMMM Do YYYY (h:mm a)').isValid())// Prints `true`.varmoment=require('moment');console.log(moment('Wednesday, December 30th 2020 (6:00 pm)','dddd, MMMM Do YYYY (h:mm a)').isValid())
Information
Day.js Version 1.9.8
OS: macOS - Node.js
Time zone: Pacific
The text was updated successfully, but these errors were encountered:
Describe the bug
Parsing dates with a named day of the week fails. However, switching the function to call
moment
works as expected.Information
The text was updated successfully, but these errors were encountered: