← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6861: Removed obsolete code in RelativePeriods

 

------------------------------------------------------------
revno: 6861
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-05-04 16:40:42 +0200
message:
  Removed obsolete code in RelativePeriods
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-05-04 12:57:46 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java	2012-05-04 14:40:42 +0000
@@ -524,15 +524,9 @@
      * @param date   the date representing now, ignored if null.
      * @return a date.
      */
-    public Date getDate( int months, Date date )
+    private Date getDate( int months, Date date )
     {
-        Calendar cal = PeriodType.createCalendarInstance();
-
-        if ( date != null ) // For testing purposes
-        {
-            cal.setTime( date );
-        }
-
+        Calendar cal = PeriodType.createCalendarInstance( date );
         cal.add( Calendar.MONTH, (months * -1) );
 
         return cal.getTime();