You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/01/03 10:21:10 UTC

[GitHub] [commons-lang] ugonen commented on a change in pull request #688: [LANG-1637] Fix 2 digit week year formatting

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:
users@infra.apache.org