diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2016-09-16 10:48:42 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2016-09-16 10:48:42 -0400 |
| commit | 839a053f150163544cea685a70a2c1cc0cf5875c (patch) | |
| tree | 82db4f4f9c77e7fc933f55bf3254c1511459049a | |
| parent | 38cf76c23d1ac990fa9a8095006b9a684d07d99f (diff) | |
#330 - added max-date validation
Former-commit-id: 4ad0359ead06f633dbf48549e6bc967cb3f61dde
| -rw-r--r-- | www/js/EventDateTimeFilterCtrl.js | 8 | ||||
| -rw-r--r-- | www/templates/events-date-time-filter.html | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/www/js/EventDateTimeFilterCtrl.js b/www/js/EventDateTimeFilterCtrl.js index ee614e52..3c9bcb8a 100644 --- a/www/js/EventDateTimeFilterCtrl.js +++ b/www/js/EventDateTimeFilterCtrl.js @@ -25,6 +25,10 @@ angular.module('zmApp.controllers') } }; + $scope.$on('$ionicView.beforeEnter', function () { + $scope.today = moment().format("YYYY-MM-DD"); + }); + //-------------------------------------------------------------------------- // Clears filters //-------------------------------------------------------------------------- @@ -89,6 +93,10 @@ angular.module('zmApp.controllers') $rootScope.toString = moment($rootScope.toDate).format("YYYY-MM-DD") + " " + moment($rootScope.toTime).format("HH:mm:ss"); + + + + //console.log("CONCAT DATES " + temp); // // var startDate = moment(temp).format("YYYY-MM-DD hh:mm:ss"); diff --git a/www/templates/events-date-time-filter.html b/www/templates/events-date-time-filter.html index 465f79e5..84e39ea2 100644 --- a/www/templates/events-date-time-filter.html +++ b/www/templates/events-date-time-filter.html @@ -5,7 +5,7 @@ <ion-content> <label class="item item-input"> <span class="input-label">{{'kFromDate'|translate}}:</span> - <input type="date" ng-model="$root.fromDate"> + <input type="date" ng-model="$root.fromDate" max={{today}}> </label> <label class="item item-input"> <span class="input-label">{{'kFromTime'|translate}}</span> @@ -13,7 +13,7 @@ </label> <label class="item item-input"> <span class="input-label">{{'kToDate'|translate}}</span> - <input type="date" ng-model="$root.toDate"> + <input type="date" ng-model="$root.toDate" max={{today}}> </label> <label class="item item-input"> <span class="input-label">{{'kToTime'|translate}}</span> |
