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

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      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

            Assignee:
            zsolt.berentey Zsolt Berentey (Inactive)
            Reporter:
            zsolt.berentey Zsolt Berentey (Inactive)
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              9 years, 10 weeks, 5 days ago

                Packages

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