dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #29869
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15161: minor error check in PeriodGenerator constructor
------------------------------------------------------------
revno: 15161
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-05-06 11:11:23 +0700
message:
minor error check in PeriodGenerator constructor
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-05-06 04:09:19 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js 2014-05-06 04:11:23 +0000
@@ -153,6 +153,10 @@
calendar = calendar || dhis2.period.calendar;
format = format || dhis2.period.DEFAULT_DATE_FORMAT;
+ if( typeof calendar === 'undefined' ) {
+ throw new Error('calendar parameter was not provided or is undefined, and no global dhis2.period.calendar instance exists.')
+ }
+
$.extend(this, {
calendar: calendar,
format: format,