#148 DateTimeFormatter.parseInto broken when no year in format

closed
nobody
Joda-Time (76)
5
2012-10-08
2012-04-28
pipelare
No

In Joda Time 2.0, the default year was set to 2000 so that Feb 29 could be parsed correctly. However, parseInto now overwrites the given instant's year with 2000 (or whatever iDefaultYear is set to). The correct behavior would seem to be to use the given instant's year instead of iDefaultYear.
This does mean that Feb 29 might not be parseable if the instant's year is not a leap year, but in this case the caller asked for that in a sense.

Discussion

  • pipelare
    pipelare
    2012-04-28

    Diff showing what I think should be the right behaviour

     
    Attachments
  • Code fixed in git, thanks