mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-20 19:37:09 +02:00
Updated datepicker
This commit is contained in:
parent
5a99b705d2
commit
49f0c92015
12 changed files with 75 additions and 38 deletions
|
@ -141,7 +141,7 @@ angular.module('rallly')
|
|||
}
|
||||
}
|
||||
})
|
||||
.directive('timePicker', function(){
|
||||
.directive('timePicker', function($timeout){
|
||||
return {
|
||||
scope : {
|
||||
model : '=ngModel'
|
||||
|
@ -149,9 +149,12 @@ angular.module('rallly')
|
|||
require : 'ngModel',
|
||||
link : function(scope, el, attrs, ngModel){
|
||||
ngModel.$viewChangeListeners.push(function(){
|
||||
scope.model = Date.parse(ngModel.$modelValue);
|
||||
ngModel.$setViewValue(scope.model.toString("hh:mm tt"));
|
||||
ngModel.$render();
|
||||
scope.model = ngModel.$modelValue;
|
||||
});
|
||||
|
||||
ngModel.$parsers.push(function (value) {
|
||||
if (!value) return;
|
||||
return Date.parse(value);
|
||||
});
|
||||
|
||||
ngModel.$validators.time = function(modelValue, viewValue){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue