Skip to content

customParseFormat plugin make some mistakes #1194

Closed
@lyz810

Description

@lyz810

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

  • Day.js Version 1.9.5
  • OS: Mac OS X 10.15.7
  • Browser : Chrome/86.0.4240.80
  • Time zone: GMT +08:00

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions