Your Moment example is an example of what NOT to do with Moment. Moment only reliably parses ISO 8601 formats. Any other format behaves inconsistent and therefore should be given the format being use during the parsing. That is outlined in their docs momentjs.com/docs/#/parsing/string.
moment('2018-3-14', 'YYYY-M-DD') produces a valid date.
True. I just wanted to point out that you need to know what you are doing (while using moment or native dates) and just using moment blindly does not solve everything.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Your Moment example is an example of what NOT to do with Moment. Moment only reliably parses ISO 8601 formats. Any other format behaves inconsistent and therefore should be given the format being use during the parsing. That is outlined in their docs momentjs.com/docs/#/parsing/string.
moment('2018-3-14', 'YYYY-M-DD') produces a valid date.
True. I just wanted to point out that you need to know what you are doing (while using moment or native dates) and just using moment blindly does not solve everything.