← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20026: bug fix in date validation

 

------------------------------------------------------------
revno: 20026
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-09-07 14:18:28 +0200
message:
  bug fix in date validation
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.validations.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.angular.validations.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.validations.js	2015-09-03 14:22:27 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.validations.js	2015-09-07 12:18:28 +0000
@@ -68,10 +68,9 @@
                 }
                 var maxDate = $parse(attrs.maxDate)(scope);
                 var convertedDate = DateUtils.format(angular.copy(value));
-                var isValid = value === convertedDate;
-                var calendarSetting = CalendarService.getSetting();
+                var isValid = value === convertedDate;                
                 if(isValid){
-                    isValid = maxDate === 0 ? !moment(convertedDate, calendarSetting.momentFormat).isAfter(DateUtils.getToday()) : isValid;
+                    isValid = maxDate === 0 ? !moment(convertedDate).isAfter(DateUtils.getToday()) : isValid;
                 }
                 return isValid;
             };