Describe the bug
import dayjs from 'dayjs';
import customParseFormat from 'dayjs/plugin/customParseFormat';
// this is right
console.log(dayjs('2020-01-01', 'YYYY-MM-DD', true).isValid());// true
// using customParseFormat plugin
dayjs.extend(customParseFormat);
// this is wrong, after customParseFormat plugin loaded
console.log(dayjs('2020-01-01', 'YYYY-MM-DD', true).isValid());// false
Expected behavior
The second console.log should print true as the first one.
Information
I've the same problem when I'm trying to use strict format:
This example should return true:
dayjs.extend(customParseFormat);
dayjs(
'2020-11-08 19:34:39',
'YYYY-MM-DD HH:mm:ss',
true
).isValid() // false
https://repl.it/@alexw0/dayjs-test#index.js
Is this a bug or are we doing anything wrong?
I am actually noticing this is an issue between 1.9.4 and 1.9.5. I was seeing tests failing when we upgraded to 1.9.5 but they are not in 1.9.4.
Will fix soon in the next release.
:tada: This issue has been resolved in version 1.9.6 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Most helpful comment
Will fix soon in the next release.