← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16750: minor fix for AnalyticsTable, make sure that tableName uses local year

 

------------------------------------------------------------
revno: 16750
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-09-18 22:41:40 +0700
message:
  minor fix for AnalyticsTable, make sure that tableName uses local year
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsTable.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-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsTable.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsTable.java	2014-05-10 11:18:29 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsTable.java	2014-09-18 15:41:40 +0000
@@ -30,7 +30,9 @@
 
 import java.util.List;
 
+import org.hisp.dhis.calendar.DateTimeUnit;
 import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.program.Program;
 
 /**
@@ -85,7 +87,8 @@
         
         if ( period != null )
         {
-            name += "_" + period.getIsoDate();
+            // name += "_" + period.getIsoDate();
+            name += "_" + PeriodType.getCalendar().fromIso( DateTimeUnit.fromJdkDate( period.getStartDate() ) ).getYear();
         }
         
         if ( program != null )
@@ -102,7 +105,8 @@
 
         if ( period != null )
         {
-            name += "_" + period.getIsoDate();
+            // name += "_" + period.getIsoDate();
+            name += "_" + PeriodType.getCalendar().fromIso( DateTimeUnit.fromJdkDate( period.getStartDate() ) ).getYear();
         }
         
         if ( program != null )