← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15058: minor fix

 

------------------------------------------------------------
revno: 15058
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-04-28 17:58:12 +0545
message:
  minor fix
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js


--
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-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-04-28 10:11:39 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-04-28 12:13:12 +0000
@@ -37,7 +37,7 @@
 /**
  * A period generator that uses a specified calendar chronology to generate DHIS 2 periods.
  *
- * There is probably not a reason to use this directly, on startup, two global variables have been made available:
+ * There is probably no reason to use this directly, since on startup, two global variables have been made available:
  *  - dhis2.period.calendar   The currently selected system calendar
  *  - dhis2.period.generator  An instance of this class using the system calendar
  *
@@ -226,7 +226,7 @@
       offset = 0;
     }
 
-    var year = cal.today().year() - offset;
+    var year = offset + cal.today().year();
     var periods = [];
 
     var startDate = cal.newDate(year, 1, 1);
@@ -257,7 +257,7 @@
       offset = 0;
     }
 
-    var year = cal.today().year() - offset;
+    var year = offset + cal.today().year();
     var periods = [];
 
     var startDate = cal.newDate(year, 1, 1);
@@ -302,7 +302,7 @@
       offset = 0;
     }
 
-    var year = cal.today().year() - offset;
+    var year = offset + cal.today().year();
     var periods = [];
 
     for( var month = 1; month <= cal.monthsInYear(year); month++ ) {
@@ -335,7 +335,7 @@
       offset = 0;
     }
 
-    var year = cal.today().year() - offset;
+    var year = offset + cal.today().year();
     var periods = [];
 
     for( var month = 1; month <= cal.monthsInYear(year); month += 2 ) {
@@ -369,7 +369,7 @@
       offset = 0;
     }
 
-    var year = cal.today().year() - offset;
+    var year = offset + cal.today().year();
     var periods = [];
 
     for( var month = 1, idx = 1; month <= cal.monthsInYear(year); month += 3, idx++ ) {
@@ -403,8 +403,7 @@
       offset = 0;
     }
 
-    var year = cal.today().year() - offset;
-
+    var year = offset + cal.today().year();
     var periods = [];
 
     var startDate = cal.newDate(year, 1, 1);
@@ -452,7 +451,7 @@
       offset = 0;
     }
 
-    var year = cal.today().year() - offset;
+    var year = offset + cal.today().year();
     var periods = [];
 
     var startDate = cal.newDate(year, 4, 1);
@@ -500,7 +499,7 @@
       offset = 0;
     }
 
-    var year = cal.today().year() - offset;
+    var year = offset + cal.today().year();
     var periods = [];
 
     // generate 11 years, thisYear +/- 5 years
@@ -547,7 +546,7 @@
       offset = 0;
     }
 
-    var year = cal.today().year() - offset;
+    var year = offset + cal.today().year();
     var periods = [];
 
     var startDate = cal.newDate(year - 5, monthStart, 1);