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

[Feature Request] Add global option to raise errors on invalid dates or fallbacks to new Date(d) #4985

Closed
andreynering opened this issue Feb 6, 2019 · 4 comments

Comments

@andreynering
Copy link

Something that frustrates me on Moment is that it's hard to debug problems when an Invalid date pops somewhere but you don't know where it came from. I think Moment should have a global option to just throw an error on invalid dates.

An error screams in your face you have a problem, and come with a stack trace to know where it came from.

Even if someone doesn't want to enable it on production, it'd useful on debugging situations. In my case, though, I'd have it even on production, so errors would pop on Sentry and console, etc.

Additionally, it'd be nice to have a global option to raise if Moment have to fallback to new Date(d) due a missing format argument, instead of just showing a warning.

@MichaelYogar
Copy link

Hi, I'm looking to make my first open source contribution. Is this feature still needed? If so, I can try to do this.

@marwahaha
Copy link
Member

marwahaha commented Oct 19, 2020

@MichaelYogar no, sorry, if I decide to do this I will take the existing PR.

@TimShilov
Copy link

Hi @marwahaha, I really need this feature but it seems like it isn't moving anywhere. Are you sure no help is needed? I'd like to help and create a PR.

@marwahaha
Copy link
Member

@TimShilov - new development on Moment.js is very slow. You can fork this repository, add the existing PR, and make a package, if you need this feature.

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

5 participants
@marwahaha @andreynering @TimShilov @MichaelYogar and others