← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15006: Renamed toIsoInterval => toInterval, renamed types YEAR, MONTH, WEEK => ISO8601_type.

 

------------------------------------------------------------
revno: 15006
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-04-27 08:10:10 +0545
message:
  Renamed toIsoInterval => toInterval, renamed types YEAR, MONTH, WEEK => ISO8601_type.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/Calendar.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/ChronologyBasedCalendar.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateInterval.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/impl/NepaliCalendar.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/calendar/Calendar.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/Calendar.java	2014-04-27 02:21:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/Calendar.java	2014-04-27 02:25:10 +0000
@@ -81,11 +81,11 @@
     /**
      * Gets interval of type based on DateUnit
      * @param dateUnit DateUnit representing local year, month, day
-     * @return ISO 8601 interval for year
+     * @return Interval for interval type based on dateUnit
      * @see <a href="http://en.wikipedia.org/wiki/ISO_8601";>http://en.wikipedia.org/wiki/ISO_8601</a>
      * @see DateInterval.DateIntervalType
      */
-    DateInterval toIsoInterval( DateUnit dateUnit, DateInterval.DateIntervalType type );
+    DateInterval toInterval( DateUnit dateUnit, DateInterval.DateIntervalType type );
 
     /**
      * Gets current date as local DateUnit

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/ChronologyBasedCalendar.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/ChronologyBasedCalendar.java	2014-04-27 02:21:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/ChronologyBasedCalendar.java	2014-04-27 02:25:10 +0000
@@ -62,15 +62,15 @@
     }
 
     @Override
-    public DateInterval toIsoInterval( DateUnit dateUnit, DateInterval.DateIntervalType type )
+    public DateInterval toInterval( DateUnit dateUnit, DateInterval.DateIntervalType type )
     {
         switch ( type )
         {
-            case YEAR:
+            case ISO8601_YEAR:
                 return toYearIsoInterval( dateUnit );
-            case MONTH:
+            case ISO8601_MONTH:
                 return toMonthIsoInterval( dateUnit );
-            case WEEK:
+            case ISO8601_WEEK:
                 return toWeekIsoInterval( dateUnit );
         }
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateInterval.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateInterval.java	2014-04-27 02:21:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/DateInterval.java	2014-04-27 02:25:10 +0000
@@ -40,7 +40,14 @@
 {
     public enum DateIntervalType
     {
-        YEAR, MONTH, WEEK
+        // Gives interval as ISO 8601 year
+        ISO8601_YEAR,
+
+        // Gives interval as ISO 8601 month
+        ISO8601_MONTH,
+
+        // Gives interval as ISO 8601 week
+        ISO8601_WEEK
     }
 
     /**

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/impl/NepaliCalendar.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/impl/NepaliCalendar.java	2014-04-27 02:21:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/calendar/impl/NepaliCalendar.java	2014-04-27 02:25:10 +0000
@@ -127,15 +127,15 @@
     }
 
     @Override
-    public DateInterval toIsoInterval( DateUnit dateUnit, DateInterval.DateIntervalType type )
+    public DateInterval toInterval( DateUnit dateUnit, DateInterval.DateIntervalType type )
     {
         switch ( type )
         {
-            case YEAR:
+            case ISO8601_YEAR:
                 return toYearIsoInterval( dateUnit );
-            case MONTH:
+            case ISO8601_MONTH:
                 return toMonthIsoInterval( dateUnit );
-            case WEEK:
+            case ISO8601_WEEK:
                 return toWeekIsoInterval( dateUnit );
         }