Because ISO dates are typically not used for direct human consumption and rather as a data interchange format, returning the string "Invalid Date" isn't very useful. Throwing a RangeError (which the native JS date object does) or returning null or would be more useful.
Description of the Issue and Steps to Reproduce:
create an invalid moment object (e.g. moment(null) or moment("0000-00-00"))
call toISOString on the invalid moment
see the string 'Invalid Date' is returned
Environment:
Chrome on Fedora
Because ISO dates are typically not used for direct human consumption and rather as a data interchange format, returning the string "Invalid Date" isn't very useful. Throwing a RangeError (which the native JS date object does) or returning null or would be more useful.
Description of the Issue and Steps to Reproduce:
create an invalid moment object (e.g. moment(null) or moment("0000-00-00"))
call toISOString on the invalid moment
see the string 'Invalid Date' is returned
Environment:
Chrome on Fedora