← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15039: minor fixes to js period generator

 

------------------------------------------------------------
revno: 15039
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-04-28 11:18:12 +0545
message:
  minor fixes to js period generator
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 05:18:45 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2014-04-28 05:33:12 +0000
@@ -35,26 +35,28 @@
     calendar = dhis2.period.calendar;
   }
 
-  this.calendar = calendar;
-
   var periodTypes = {
-    "Daily": dhis2.period.makeDailyPeriodGenerator(this.calendar),
-    "Weekly": dhis2.period.makeWeeklyPeriodGenerator(this.calendar),
-    "Monthly": dhis2.period.makeMonthlyPeriodGenerator(this.calendar),
-    "BiMonthly": dhis2.period.makeBiMonthlyPeriodGenerator(this.calendar),
-    "Quarterly": dhis2.period.makeQuarterlyPeriodGenerator(this.calendar),
-    "SixMonthly": dhis2.period.makeSixMonthlyPeriodGenerator(this.calendar),
-    "SixMonthlyApril": dhis2.period.makeSixMonthlyAprilPeriodGenerator(this.calendar),
-    "Yearly": dhis2.period.makeYearlyPeriodGenerator(this.calendar),
-    "FinancialOct": dhis2.period.makeMonthlyPeriodGenerator(this.calendar),
-    "FinancialJuly": dhis2.period.makeMonthlyPeriodGenerator(this.calendar),
-    "FinancialApril": dhis2.period.makeMonthlyPeriodGenerator(this.calendar)
+    "Daily": dhis2.period.makeDailyPeriodGenerator(calendar),
+    "Weekly": dhis2.period.makeWeeklyPeriodGenerator(calendar),
+    "Monthly": dhis2.period.makeMonthlyPeriodGenerator(calendar),
+    "BiMonthly": dhis2.period.makeBiMonthlyPeriodGenerator(calendar),
+    "Quarterly": dhis2.period.makeQuarterlyPeriodGenerator(calendar),
+    "SixMonthly": dhis2.period.makeSixMonthlyPeriodGenerator(calendar),
+    "SixMonthlyApril": dhis2.period.makeSixMonthlyAprilPeriodGenerator(calendar),
+    "Yearly": dhis2.period.makeYearlyPeriodGenerator(calendar),
+    "FinancialOct": dhis2.period.makeMonthlyPeriodGenerator(calendar),
+    "FinancialJuly": dhis2.period.makeMonthlyPeriodGenerator(calendar),
+    "FinancialApril": dhis2.period.makeMonthlyPeriodGenerator(calendar)
   };
 
   this.getAll = function() {
     return periodTypes;
   };
 
+  this.getCalendar = function() {
+    return calendar;
+  };
+
   this.get = function( generator ) {
     return periodTypes[generator];
   };
@@ -223,7 +225,7 @@
       var period = {};
       period['startDate'] = startDate.formatDate(dhis2.period.DEFAULT_DATE_FORMAT);
       period['endDate'] = endDate.formatDate(dhis2.period.DEFAULT_DATE_FORMAT);
-      period['name'] = startDate.formatDate("MM") + '-' + endDate.formatDate('MM') + ' ' + year;
+      period['name'] = startDate.formatDate("MM") + ' - ' + endDate.formatDate('MM') + ' ' + year;
       period['id'] = 'BiMonthly_' + period['startDate'];
       period['iso'] = startDate.formatDate("yyyymm") + 'B';
 
@@ -254,7 +256,7 @@
       var period = {};
       period['startDate'] = startDate.formatDate(dhis2.period.DEFAULT_DATE_FORMAT);
       period['endDate'] = endDate.formatDate(dhis2.period.DEFAULT_DATE_FORMAT);
-      period['name'] = startDate.formatDate("MM") + '-' + endDate.formatDate('MM') + ' ' + year;
+      period['name'] = startDate.formatDate("MM") + ' - ' + endDate.formatDate('MM') + ' ' + year;
       period['id'] = 'Quarterly_' + period['startDate'];
       period['iso'] = startDate.formatDate("yyyy") + 'Q' + idx;
 
@@ -285,7 +287,7 @@
     var period = {};
     period['startDate'] = startDate.formatDate(dhis2.period.DEFAULT_DATE_FORMAT);
     period['endDate'] = endDate.formatDate(dhis2.period.DEFAULT_DATE_FORMAT);
-    period['name'] = startDate.formatDate("MM") + '-' + endDate.formatDate('MM') + ' ' + year;
+    period['name'] = startDate.formatDate("MM") + ' - ' + endDate.formatDate('MM') + ' ' + year;
     period['id'] = 'SixMonthly_' + period['startDate'];
     period['iso'] = startDate.formatDate("yyyy") + 'S1';
 
@@ -298,7 +300,7 @@
     period = {};
     period['startDate'] = startDate.formatDate(dhis2.period.DEFAULT_DATE_FORMAT);
     period['endDate'] = endDate.formatDate(dhis2.period.DEFAULT_DATE_FORMAT);
-    period['name'] = startDate.formatDate("MM") + '-' + endDate.formatDate('MM') + ' ' + year;
+    period['name'] = startDate.formatDate("MM") + ' - ' + endDate.formatDate('MM') + ' ' + year;
     period['id'] = 'SixMonthly_' + period['startDate'];
     period['iso'] = startDate.formatDate("yyyy") + 'S2';