[
https://issues.apache.org/jira/browse/LANG-1637?focusedWorklogId=530372&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-530372
]
ASF GitHub Bot logged work on LANG-1637:
----------------------------------------
Author: ASF GitHub Bot
Created on: 03/Jan/21 10:21
Start Date: 03/Jan/21 10:21
Worklog Time Spent: 10m
Work Description: ugonen commented on a change in pull request #688:
URL: https://github.com/apache/commons-lang/pull/688#discussion_r550986137
##########
File path: src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
##########
@@ -1118,7 +1118,7 @@ public void appendTo(final Appendable buffer, final
Calendar calendar) throws IO
*/
@Override
public final void appendTo(final Appendable buffer, final int value)
throws IOException {
- appendDigits(buffer, value);
+ appendDigits(buffer, value % 100);
Review comment:
the name TwoDigitYearField implies this class encapsulates formatting of
year field to a 2 digit string. as such, it seems reasonable for it to have the
logic to take any year integer and map it to a decade followed by a year digits.
you can also see that the other method in this class
`void appendTo(Appendable buf, Calendar calendar) throws IOException`
implementing the Rule interface, does the same
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 530372)
Time Spent: 3.5h (was: 3h 20m)
> FastDatePrinter formatting using YY pattern yields junk digits
> --------------------------------------------------------------
>
> Key: LANG-1637
> URL: https://issues.apache.org/jira/browse/LANG-1637
> Project: Commons Lang
> Issue Type: Bug
> Affects Versions: 3.11
> Reporter: Uri Gonen
> Priority: Minor
> Time Spent: 3.5h
> Remaining Estimate: 0h
>
> {code:java}
> final GregorianCalendar cal = new GregorianCalendar(2020, 12, 31, 0, 0, 0);
> final DatePrinter printer2Digits = getInstance("YY");
> assertEquals("21", printer2Digits.format(cal));
> {code}
> the above test fails
--
This message was sent by Atlassian Jira
(v8.3.4#803005)