← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16690: calendar fixes, fixes for future period filter, and fixes for CData objects (make sure to create ...

 

------------------------------------------------------------
revno: 16690
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-09-11 12:01:15 +0700
message:
  calendar fixes, fixes for future period filter, and fixes for CData objects (make sure to create new instance)
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-09-03 06:55:58 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-09-11 05:01:15 +0000
@@ -339,7 +339,7 @@
   var today = this.calendar.today();
 
   $.each(periods, function() {
-    if( this['_endDate'].compareTo(today) <= 0 ) {
+    if( this['_endDate'].compareTo(today) < 0 ) {
       array.push(this);
     }
   });
@@ -442,8 +442,8 @@
       period['id'] = 'Daily_' + period['startDate'];
       period['iso'] = startDate.formatDate("yyyymmdd");
 
-      period['_startDate'] = startDate;
-      period['_endDate'] = startDate;
+      period['_startDate'] = this.calendar.newDate(startDate);
+      period['_endDate'] = this.calendar.newDate(startDate);
 
       periods.push(period);
 
@@ -491,8 +491,8 @@
       period['id'] = 'Weekly_' + period['startDate'];
       period['iso'] = year + 'W' + week;
 
-      period['_startDate'] = startDate;
-      period['_endDate'] = endDate;
+      period['_startDate'] = this.calendar.newDate(startDate);
+      period['_endDate'] = this.calendar.newDate(endDate);
 
       periods.push(period);
 
@@ -538,8 +538,8 @@
       period['id'] = 'Monthly_' + period['startDate'];
       period['iso'] = startDate.formatDate("yyyymm");
 
-      period['_startDate'] = startDate;
-      period['_endDate'] = endDate;
+      period['_startDate'] = this.calendar.newDate(startDate);
+      period['_endDate'] = this.calendar.newDate(endDate);
 
       periods.push(period);
     }
@@ -580,8 +580,8 @@
       period['id'] = 'BiMonthly_' + period['startDate'];
       period['iso'] = startDate.formatDate("yyyymm") + 'B';
 
-      period['_startDate'] = startDate;
-      period['_endDate'] = endDate;
+      period['_startDate'] = this.calendar.newDate(startDate);
+      period['_endDate'] = this.calendar.newDate(endDate);
 
       periods.push(period);
     }
@@ -622,8 +622,8 @@
       period['id'] = 'Quarterly_' + period['startDate'];
       period['iso'] = startDate.formatDate("yyyy") + 'Q' + idx;
 
-      period['_startDate'] = startDate;
-      period['_endDate'] = endDate;
+      period['_startDate'] = this.calendar.newDate(startDate);
+      period['_endDate'] = this.calendar.newDate(endDate);
 
       periods.push(period);
     }
@@ -663,8 +663,8 @@
     period['id'] = 'SixMonthly_' + period['startDate'];
     period['iso'] = startDate.formatDate("yyyy") + 'S1';
 
-    period['_startDate'] = startDate;
-    period['_endDate'] = endDate;
+    period['_startDate'] = this.calendar.newDate(startDate);
+    period['_endDate'] = this.calendar.newDate(endDate);
 
     periods.push(period);
 
@@ -679,8 +679,8 @@
     period['id'] = 'SixMonthly_' + period['startDate'];
     period['iso'] = startDate.formatDate("yyyy") + 'S2';
 
-    period['_startDate'] = startDate;
-    period['_endDate'] = endDate;
+    period['_startDate'] = this.calendar.newDate(startDate);
+    period['_endDate'] = this.calendar.newDate(endDate);
 
     periods.push(period);
 
@@ -719,8 +719,8 @@
     period['id'] = 'SixMonthlyApril_' + period['startDate'];
     period['iso'] = startDate.formatDate("yyyy") + 'AprilS1';
 
-    period['_startDate'] = startDate;
-    period['_endDate'] = endDate;
+    period['_startDate'] = this.calendar.newDate(startDate);
+    period['_endDate'] = this.calendar.newDate(endDate);
 
     periods.push(period);
 
@@ -735,8 +735,8 @@
     period['id'] = 'SixMonthlyApril_' + period['startDate'];
     period['iso'] = startDate.formatDate("yyyy") + 'AprilS2';
 
-    period['_startDate'] = startDate;
-    period['_endDate'] = endDate;
+    period['_startDate'] = this.calendar.newDate(startDate);
+    period['_endDate'] = this.calendar.newDate(endDate);
 
     periods.push(period);
 
@@ -777,8 +777,8 @@
       period['id'] = 'Yearly_' + period['startDate'];
       period['iso'] = startDate.formatDate("yyyy");
 
-      period['_startDate'] = startDate;
-      period['_endDate'] = endDate;
+      period['_startDate'] = this.calendar.newDate(startDate);
+      period['_endDate'] = this.calendar.newDate(endDate);
 
       periods.push(period);
     }
@@ -828,8 +828,8 @@
       period['id'] = 'Financial' + this.monthShortName + '_' + period['startDate'];
       period['iso'] = startDate.formatDate("yyyy") + this.monthShortName;
 
-      period['_startDate'] = startDate;
-      period['_endDate'] = endDate;
+      period['_startDate'] = this.calendar.newDate(startDate);
+      period['_endDate'] = this.calendar.newDate(endDate);
 
       periods.push(period);
       startDate.add(1, 'y');