-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.1.0 CE GA1, 6.1.10 EE GA1, 6.2.0 CE M2
-
Fix Version/s: 6.1.20 EE GA2, --Sprint 11/12, 6.2.0 CE M2
-
Component/s: Social Activity, ~ [Archived] Social Networking
-
Labels:None
-
Branch Version/s:6.1.x
-
Backported to Branch:Committed
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);