Skip to content

Order of plugin extends breaks plugin functions #2027

Closed
@Worly

Description

Describe the bug
I'm trying to use two plugins (duration and objectSupport) in my Angular app. While using datejs#add function with argument of type Duration (implemented in duration plugin), I get Invalid Date if the plugin objectSupport is extended after the duration plugin. If objectSupport is extended before the duration plugin then add method works fine.

Demo
CodeSandbox link https://codesandbox.io/s/festive-sutherland-thxuux?file=/src/app/app.module.ts
In app.module.ts, change the order of lines 10 and 11, and look at console after refreshing Browser preview tab.

Expected behavior
No matter the order of plugin extends, all plugin functions should work as expected.

Information

  • Day.js Version ^1.11.5
  • OS: Windows 10
  • Browser Chrome/103.0.5060.134

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions