← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7677: Minor fixed.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 7677 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-07-23 21:04:21 +0200
message:
  Minor fixed.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java	2012-07-23 17:00:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java	2012-07-23 19:02:02 +0000
@@ -374,11 +374,11 @@
      */
     public List<Period> getRewindedRelativePeriods( Integer rewindedPeriods )
     {
-        List<Period> periods = getRelativePeriods();
-        
+        List<Period> periods = getRelativePeriods();        
         PeriodType periodType = getHighestFrequencyPeriodType( periods );
         
-        Date rewindedDate = periodType.getRewindedDate( null, rewindedPeriods );
+        Date rewindedDate = periodType.getRewindedDate( null, rewindedPeriods );        
+        rewindedDate = subtractMonth( 1, rewindedDate );
         
         return getRelativePeriods( rewindedDate, null, false );
     }
@@ -423,7 +423,7 @@
      */
     public List<Period> getRelativePeriods( Date date, I18nFormat format, boolean dynamicNames )
     {        
-        date = date == null ? subtractMonth( 1, new Date() ) : subtractMonth( 1, date );
+        date = date == null ? subtractMonth( 1, new Date() ) : date;
         
         List<Period> periods = new ArrayList<Period>();