I recently found that after an upgrade to Angular 1.3.9 some of the standard AngularJS $locale DATETIME_FORMATS were no longer converting properly to the moment equivalent. It turns out that many of the DATETIME_FORMATS strings were converted to use the single 'y' representation of the year instead of the 'yyyy'.
It seems a little odd but unlike the 'yy' string, this should result in full display of the year (just with no padding 0s for years of fewer than 4 digits).
From the angular locale docs:
'y': 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)
It appears that SimpleDateFormat exhibits the same behaviour.
It looks like there isn't an exact equivalent of 'y' in momentjs format strings but the addition of the javaFormatMapping - y: 'YYYY' might provide an approximation.
hey @peterot thanks a lot for raising the issue and sorry for the long delay in the response. I talked to @MadMG earlier and we'll incorporate the y:YYYY mapping to match the SimpleDataFormat formats.
Hi,
I recently found that after an upgrade to Angular 1.3.9 some of the standard AngularJS $locale DATETIME_FORMATS were no longer converting properly to the moment equivalent. It turns out that many of the DATETIME_FORMATS strings were converted to use the single 'y' representation of the year instead of the 'yyyy'.
It seems a little odd but unlike the 'yy' string, this should result in full display of the year (just with no padding 0s for years of fewer than 4 digits).
From the angular locale docs: 'y': 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)
It appears that SimpleDateFormat exhibits the same behaviour.
It looks like there isn't an exact equivalent of 'y' in momentjs format strings but the addition of the javaFormatMapping - y: 'YYYY' might provide an approximation.
Thanks