← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15870: use iso based dateunit in ResourceTableService, fixes a bug with nepali calender

 

------------------------------------------------------------
revno: 15870
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-06-27 15:17:57 +0700
message:
  use iso based dateunit in ResourceTableService, fixes a bug with nepali calender
modified:
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.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-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java	2014-06-23 15:07:29 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java	2014-06-27 08:17:57 +0000
@@ -45,6 +45,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.calendar.Calendar;
+import org.hisp.dhis.calendar.DateUnit;
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.CategoryOptionGroup;
 import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
@@ -440,8 +441,8 @@
         
         List<Object[]> batchArgs = new ArrayList<Object[]>();
         
-        Date startDate = new Cal( 1975, 1, 1 ).time(); //TODO
-        Date endDate = new Cal( 2030, 1 , 1 ).time();
+        Date startDate = new DateUnit( 1975, 1, 1, true ).toJdkDate(); //TODO
+        Date endDate = new DateUnit( 2030, 1 , 1, true ).toJdkDate();
                 
         List<Period> days = new DailyPeriodType().generatePeriods( startDate, endDate );