javascript - moment.js 2 digit year converting wrong 4 digit year -
has come across issue moment.js: in firefox using moment("6/12/15").format("m/d/yyyy h:mm:ss a") 6/12/1915 instead of 6/12/2015?
when throw random string moment
without telling format it's in, falls on javascript date
object parsing, , format you're passing in not defined standard. leaves wide open implementation-specific behavior. in case, describe happens on firefox not on chrome.
this has been sufficient issue moment deprecating entirely.
to reliable results string, tell moment format it's in:
moment("6/12/15", "m/d/yy").format("m/d/yyyy h:mm:ss a")
Comments
Post a Comment