timrwood/moment — Issue #68: Validation
Author: chrisfarber
Created: 2011-11-15 21:00:29+00:00
State: open

I would like to use moment in a project, but it does not provide any kind of reliable validation. For example:

> moment("yams", "HH:ss")
{ _d: Mon, 01 Jan 1900 05:00:00 GMT }

Unfortunately moment treats "yams" as a valid date string because it has "am" in it. Ideally, when the input doesn't match the provided format string, it would somehow present an error instead of continuing as if the user had actually given valid input.