]> git.ipfire.org Git - thirdparty/moment.git/commit
Fix parsing/formatting of first century dates.
authorJason Davies <jason@jasondavies.com>
Wed, 18 Jul 2012 10:13:31 +0000 (11:13 +0100)
committerJason Davies <jason@jasondavies.com>
Wed, 18 Jul 2012 10:13:31 +0000 (11:13 +0100)
commitf38f021200d1237ff65d0be9671ea384b36f5a5c
treed47962b1661bec14d5e1c05be506251d83bec0a8
parent73c0b1bd66a982660d2f039fbfc8d8cdcf2b74de
Fix parsing/formatting of first century dates.

According to ECMA-262, `new Date(y, …)` will auto-convert `y` to `1900 +
y` if `0 ≤ y ≤ 99`, hence setFullYear or setUTCFullYear is used instead.

This also zero-pads the year for the "YYYY" format, since the year may
not necessarily have four digits.

Lastly, the pt-br test is adjusted to test for the first day of the
month instead of the zeroth (which was causing it to fail).
moment.js
test/lang/pt-br.js
test/moment/create.js