← Back to team overview

dhis2-devs team mailing list archive

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

 

------------------------------------------------------------
revno: 18715
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-03-27 22:44:17 +0700
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	2015-03-27 14:46:32 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js	2015-03-27 15:44:17 +0000
@@ -118,10 +118,12 @@
   var $isoField = $(fieldId);
   var $el = $(fieldId + '-dp');
 
-  var date = this.calendar.parseDate('yyyy-mm-dd', $isoField.val());
-  var localDate = this.calendar.formatDate(this.format, date);
+  if($el.length > 0 ) {
+    var date = this.calendar.parseDate('yyyy-mm-dd', $isoField.val());
+    var localDate = this.calendar.formatDate(this.format, date);
 
-  $el.val(localDate);
+    $el.val(localDate);
+  }
 };
 
 /**