Skip to content

jMoment can be called with a moment object#68

Open
pouyamn wants to merge 2 commits intofingerpich:masterfrom
pouyamn:master
Open

jMoment can be called with a moment object#68
pouyamn wants to merge 2 commits intofingerpich:masterfrom
pouyamn:master

Conversation

@pouyamn
Copy link
Contributor

@pouyamn pouyamn commented Jul 1, 2019

moment constructor do accept arrays and moment objects as input, so should jMoment

pouyamn added 2 commits July 2, 2019 02:25
moment constructor do accept arrays and moment objects as input, so should jMoment
@pouyamn
Copy link
Contributor Author

pouyamn commented Jul 1, 2019

the test fails in cloning:

  1. moment

    #clone
    clone of an invalid date is invalid:
    AssertionError: expected true to equal false

    • expected - actual
      -true
      +false

    at Context. (test.js:9:46665)

  2. moment
    #clone should not affect on calendar system
    instance locale and clone:
    AssertionError: expected '1989/01/23' to equal '1367/11/03'

    • expected - actual
      -1989/01/23
      +1367/11/03

I don't know why it's happening, the problem with current code is that it destroies the input's config, if one uses a library which adds something to moment config through momentJS plugin system, the added context should be kept during cloning. An example of these libraries is full-calendar.js

Have anyone got any Ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant