← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16880: Fixed check for category option validity by start/end date

 

------------------------------------------------------------
revno: 16880
committer: jimgrace@xxxxxxxxx
branch nick: dhis2
timestamp: Tue 2014-09-30 08:18:07 -0400
message:
  Fixed check for category option validity by start/end date
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.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-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2014-09-30 03:45:34 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2014-09-30 12:18:07 +0000
@@ -1213,13 +1213,11 @@
 
 /**
  * Tests to see if a category option is valid during a period.
- * 
- * TODO properly check validity period
- * TODO option.startDate == null || option.startDate <= dhis2.de.periodChoices[ period ].endDate
  */
 dhis2.de.optionValidWithinPeriod = function( option, period )
 {
-    return true;
+    return ( option.startDate == null || option.startDate <= dhis2.de.periodChoices[ period ].endDate )
+        && ( option.endDate == null || option.endDate >= dhis2.de.periodChoices[ period ].startDate )
 }
 
 /**
@@ -1233,7 +1231,9 @@
 
 /**
 * Returns markup for drop down boxes to be put in the selection box for the
-* given categories. The empty string is returned if no categories are given. 
+* given categories. The empty string is returned if no categories are given.
+*
+* TODO check for category option validity for selected organisation unit.
 */
 dhis2.de.getAttributesMarkup = function()
 {