Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix moment.js deprecation warning #10

Open
Frozenfire92 opened this issue Dec 23, 2014 · 3 comments
Open

Fix moment.js deprecation warning #10

Frozenfire92 opened this issue Dec 23, 2014 · 3 comments

Comments

@Frozenfire92
Copy link
Owner

This occurs due to a future deprecation in moment.js. See issue

Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.

@adamcee
Copy link

adamcee commented Dec 26, 2014

Hi. I am encountering this issue. New to working on open-source so forgive any etiquette mistakes on my part.

When attempting to solve this issue using javascript moment(someDate).isValid() and get rid of the deprecation warning, I tried:

moment(someDate, moment.ISO_8601).isValid() 

...and still received the deprecation warning. It seems like the deprecation warning should not occur in this case. Also this could be a good use case for general date validation with the stricter moment.js

@duizendnegen
Copy link
Contributor

we could move towards only exposing moment dates or use http://momentjs.com/docs/#/parsing/string-format/
fortunately moment objects are cloneable, ref. http://momentjs.com/docs/#/parsing/moment-clone/ - means that we can move internally to make everything moment objects without breaking outside behavior

@Frozenfire92
Copy link
Owner Author

Hi @adamcahan and @duizendnegen

I've been swamped with school lately and haven't had a chance to look into this issue. Thanks for your responses and if I don't get to it sometime soon feel free to submit a PR!

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

No branches or pull requests

3 participants