MadMG / moment-jdateformatparser

Translates the `java.text.SimpleDateFormat` date format to the `moment.js` date format.
MIT License
58 stars 29 forks source link

Using 'yyy' in formatString #9

Closed abc1231qa closed 9 years ago

abc1231qa commented 9 years ago

Hi, I used "yyy" in my java code, it works like that (99 -> 099 , 999-> 999 , 9999->9999). can you please provide a way to Map 'yyy' in momentjs?

thanks

herom commented 9 years ago

Thanks a lot for bringing this up @abc1231qa - I read through the Java SimpleDateFormat documentation (year section) and I found this passage:

For parsing, if the number of pattern letters is more than 2, the year is interpreted literally, regardless of the number of digits.

So, I think the only way we can support this, is a "one way" mapping where 'yyy': 'YYYY' is the Java:Moment.js relation. What do you think @MadMG?

herom commented 9 years ago

Closing as 525c32 is resolving this issue.