← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16736: minor fix for SixMonthly PeriodTypes, need to make sure that dateUnit is local before validating

 

------------------------------------------------------------
revno: 16736
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-09-17 17:47:53 +0700
message:
  minor fix for SixMonthly PeriodTypes, need to make sure that dateUnit is local before validating
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/SixMonthlyAprilPeriodType.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/SixMonthlyPeriodType.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/SixMonthlyAprilPeriodType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/SixMonthlyAprilPeriodType.java	2014-08-29 10:02:21 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/SixMonthlyAprilPeriodType.java	2014-09-17 10:47:53 +0000
@@ -79,6 +79,11 @@
     @Override
     public String getIsoDate( DateTimeUnit dateTimeUnit )
     {
+        if ( dateTimeUnit.isIso8601() )
+        {
+            dateTimeUnit = getCalendar().fromIso( dateTimeUnit );
+        }
+
         switch ( dateTimeUnit.getMonth() )
         {
             case 4:

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/SixMonthlyPeriodType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/SixMonthlyPeriodType.java	2014-08-29 10:02:21 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/SixMonthlyPeriodType.java	2014-09-17 10:47:53 +0000
@@ -80,6 +80,11 @@
     @Override
     public String getIsoDate( DateTimeUnit dateTimeUnit )
     {
+        if ( dateTimeUnit.isIso8601() )
+        {
+            dateTimeUnit = getCalendar().fromIso( dateTimeUnit );
+        }
+
         switch ( dateTimeUnit.getMonth() )
         {
             case 1: