Open shadoworion opened 1 year ago
Ok, the problem is "." but why?
If I replace "." with "," it works.
dayjs("Sep, 27, 2017, 11:23 AM", "MMM, DD, YYYY, hh:mm A").isValid(); // => true
Sorry, I can't help but I think it's worth mentioning that according to the docs, "." is a recognized separator.
Sorry, I can't help but I think it's worth mentioning that according to the docs, "." is a recognized separator.
":", "/", "," - are also recognized separators. Appear to your logic they also may not work.
Sorry, I should've phrased my message differently.
I just wanted to highlight that the behavior you expect matches the documentation (as you used a recognized separator), so it seems like it really is a bug 🙂
Same issue here, e.g. cannot use the lib having such format:
dayjs("2022-06-08-14.42.19", "YYYY-MM-DD-HH.mm.ss").isValid() // false, expected true
After years of using Dayjs, regrettably had to switch to momentjs (package size penalty) which handles this and similar cases correctly.
Describe the bug For some reason, my date is not valid but format is correct.
https://jsfiddle.net/asLpb0cz/
Expected behavior To be valid
Information