Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

datepicker does not work with model getter/setter #2661

Closed
uazure opened this issue Sep 4, 2014 · 5 comments
Closed

datepicker does not work with model getter/setter #2661

uazure opened this issue Sep 4, 2014 · 5 comments

Comments

@uazure
Copy link

uazure commented Sep 4, 2014

I try to use datepicker in that way:
<datepicker ng-model="model.fromDate" ng-model-options="{ getterSetter: true }" ></datepicker>
having $scope.model.fromDate = function(value) {};

I got error like this:
Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.

datepicker directive should allow model to be getter/setter function

@uazure
Copy link
Author

uazure commented Oct 2, 2014

Or maybe there is some other way for system to react on changing the value?

@Yankovsky
Copy link

same problem

@yankee42
Copy link

Even if you use getter/setter you somehow need a date. So $scope.model.fromDate = function(value) {}; does not return a date. Have you tried e.g. $scope.model.fromDate = function(value) {return new Date()}; ?

@pkarikh
Copy link

pkarikh commented Jun 15, 2015

I have the same issue with typeahead.

@wesleycho
Copy link
Contributor

Closing in favor of #4837.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants