← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 206: Sorting periods descending

 

------------------------------------------------------------
revno: 206
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Mon 2009-04-20 18:57:53 +0200
message:
  Sorting periods descending
modified:
  gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetPeriodsByPeriodTypeAction.java

=== modified file 'gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetPeriodsByPeriodTypeAction.java'
--- gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetPeriodsByPeriodTypeAction.java	2009-04-17 21:35:32 +0000
+++ gis/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetPeriodsByPeriodTypeAction.java	2009-04-20 16:57:53 +0000
@@ -28,11 +28,13 @@
  */
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.period.PeriodType;
+import org.hisp.dhis.period.comparator.PeriodComparator;
 
 import com.opensymphony.xwork.Action;
 
@@ -88,6 +90,8 @@
         if ( periodType != null )
         {
             object = new ArrayList<Period>( periodService.getPeriodsByPeriodType( periodType ) );
+            
+            Collections.sort( object, new PeriodComparator() );
         }
         
         return SUCCESS;



--
Trunk
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.