commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LANG-282) Create more tests to test out the +=31 replacement code in DurationFormatUtils.
Date Fri, 08 Dec 2006 09:07:22 GMT
    [ http://issues.apache.org/jira/browse/LANG-282?page=comments#action_12456736 ] 
            
Henri Yandell commented on LANG-282:
------------------------------------

Going with the 1 month 23 day choice as the code currently does that - with a recommendation
of Joda Time if more control is needed.

 svn ci -m "Added javadoc to explain the quandry in how to count month/day differences" src/java/
Sending        src/java/org/apache/commons/lang/time/DurationFormatUtils.java
Transmitting file data .
Committed revision 483891.

> Create more tests to test out the +=31 replacement code in DurationFormatUtils.
> -------------------------------------------------------------------------------
>
>                 Key: LANG-282
>                 URL: http://issues.apache.org/jira/browse/LANG-282
>             Project: Commons Lang
>          Issue Type: Task
>            Reporter: Henri Yandell
>         Assigned To: Henri Yandell
>             Fix For: 2.3
>
>
> Code being:
>         while (days < 0) {
>             end.add(Calendar.MONTH, -1);
>             days += end.getActualMaximum(Calendar.DAY_OF_MONTH);
> //days += 31; // TODO: Need tests to show this is bad and the new code is good.
> // HEN: It's a tricky subject. Jan 15th to March 10th. If I count days-first it is
> // 1 month and 26 days, but if I count month-first then it is 1 month and 23 days.
> // Also it's contextual - if asked for no M in the format then I should probably
> // be doing no calculating here.
>             months -= 1;
>             end.add(Calendar.MONTH, 1);
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message