genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0

[Task]: Add date validation :)

This commit is contained in:
mlabusch 2017-05-19 15:37:20 +02:00
parent f1454f321c
commit 4ba6bfa009
2 changed files with 5 additions and 3 deletions

View File

@ -8,8 +8,10 @@
<form class="ui form segment" ng-submit="submit()" ng-class="{'top attached':msg.type}"> <form class="ui form segment" ng-submit="submit()" ng-class="{'top attached':msg.type}">
<div class="field"> <div class="field">
<label>Expiration Date</label> <label>Expiration Date</label>
<input type="date" name="fouled_at" placeholder="Fouled at date (e.g. 2017-06-30)" ng-model="obj.fouled_at"> <input type="date" name="fouled_at" placeholder="Fouled at date (e.g. 2017-06-30)" ng-model="obj.fouled_at"
</div> required="" pattern="((?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|
1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31)))?">
</div>
<div class="field"> <div class="field">
<label>Position</label> <label>Position</label>
<input type="text" name="position" placeholder="Location in Store", ng-model="obj.position"> <input type="text" name="position" placeholder="Location in Store", ng-model="obj.position">

View File

@ -16,7 +16,7 @@ angular.module('microStock')
$scope.obj = {}; $scope.obj = {};
$scope.msg = {type:'success',text:'Saved '+$scope.count+' good(s) from product '+$scope.product.title+'.'}; $scope.msg = {type:'success',text:'Saved '+$scope.count+' good(s) from product '+$scope.product.title+'.'};
}, function(){ }, function(){
$scope.msg = {type:'error',text:'Error: During saving of '+$scope.count+' good(s) from product '+$scope.product.title+'.'}; $scope.msg = {type:'error',text:'An error occurred while saving good(s) from product '+$scope.product.title+'.'};
}); });
}; };
}]); }]);