Recras / angular-jquery-timepicker

AngularJS directive for jQueryUI Timepicker
MIT License
53 stars 41 forks source link

Github version not working, demo works. #14

Closed stubbies closed 9 years ago

stubbies commented 9 years ago

The minified module in the demo works but not the version you have on github.

at isAMoment (timepicker.js:16)
    at link.ngModel.$render (timepicker.js:42)
    at Object.ngModelWatch (angular.js:23423)
    at Scope.$get.Scope.$digest (angular.js:14300)
    at Scope.$get.Scope.$apply (angular.js:14571)
    at angular.js:16308
    at completeOutstandingRequest (angular.js:4924)
    at angular.js:5312

I tried removing everything related to moment and it works but the model is null.

The minified version you have in the demo works but it doesn't seem to accept the lang option.

stubbies commented 9 years ago

I defined moment:

var moment;
var isAMoment = function(date) {
    return moment !== undefined && moment.isMoment(date) && date.isValid();
};

It works ok. Now the problem is when I add lang in the options, it shows the locale correctly but the ngModel is no longer updated.

stubbies commented 9 years ago

Ok the problem with the lang option is when you add periods like this: {am: 'a.m.'} or spaces {am: ' am'}

for some reason the model stops updating.

timmipetit commented 9 years ago

Could you check if this still breaks with the latest version (0.4.1)? I've fixed a bug could be related to this issue.