Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-26386

Social Activity period calculation is wrong when period length is not set to 'month'

Details

    • 6.1.x
    • Committed

    Description

      Calling getStartPeriod(long time) would never return the correct start period because offsets are calculated in the wrong direction (i.e. negative offsets go forward in time instead of back in time).

      The easiest way to reproduce is to create a unit test when counter period is set to 1 day:

      Calendar calendar = new GregorianCalendar(2011, Calendar.JANUARY, 15);

      int offset = SocialCounterPeriodUtil.getStartPeriod(calendar.getTimeInMillis());

      Assert.assertEquals(14, offset);

      Attachments

        Activity

          People

            zsolt.berentey Zsolt Berentey (Inactive)
            zsolt.berentey Zsolt Berentey (Inactive)
            Kiyoshi Lee Kiyoshi Lee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9 years, 39 weeks, 1 day ago

              Packages

                Version Package
                6.1.20 EE GA2
                --Sprint 11/12
                6.2.0 CE M2