Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-282

Create more tests to test out the +=31 replacement code in DurationFormatUtils.

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.3
    • None
    • None

    Description

      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); }

      Attachments

        Activity

          People

            bayard Henri Yandell
            bayard Henri Yandell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: