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

ControllerAs with DatePicker binds strings, not Dates #2899

Closed
mbcooper opened this issue Oct 28, 2014 · 7 comments
Closed

ControllerAs with DatePicker binds strings, not Dates #2899

mbcooper opened this issue Oct 28, 2014 · 7 comments

Comments

@mbcooper
Copy link

This may be related to another 1.3 issue, but when I use code to assign a date to the DatePicker, I get a date string (and it assigns my binding variable to undefined.)

ALSO: dates are messed up -- added 1 day!

See plunkr at http://plnkr.co/edit/TBClYQ7CHKmPL0H3SbB3?p=info

click on the link .. it will show 3-4 date pickers in a loop .. bad date binding....

@Sventric
Copy link

Also am having the first problem, the initial date seems to be set in the ngModel.$viewValue as a date-string, Then in the ngModel.$render this $viewValue is passed to the dateFilter in which this non-json-date-string is not parsed and is given back unprocessed. If i adjust the angular dateFilter (jsonStringToDate) to support the Date.toString format aswel... but that feels like a dirty hack.

@jancel
Copy link

jancel commented Jan 9, 2015

I'm running into this issue as well. Have you guys figured out a work around or any particular advice before I pull my ui-datepickers out?

@karianna
Copy link
Contributor

What versions of Angular/Bootstrap and Bootstrap UI?

@jancel
Copy link

jancel commented Jan 11, 2015

1.3.6 I do believe, bootstrap 3.x and 0.12 of ui, whichever bootstrap ui came with it, but will check on Monday. I just removed controllerAs and I was passed the issue for now.

@wesleycho
Copy link
Contributor

I'm not seeing this on current master: http://plnkr.co/edit/lm5z2glUX1a3AauKaVLu?p=preview

Has this been potentially fixed?

@wesleycho wesleycho added this to the 0.13.0 milestone Mar 22, 2015
@karianna
Copy link
Contributor

@wesleycho yeah looks like @cleftheris committed it.

@cleftheris
Copy link

Hi all, I made a PR a while back but was not accepted as the solution. There is an alternative solution in the current master that tackles the problem but is still having a bug. Check the discussion for more info #3279.

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

Successfully merging a pull request may close this issue.

7 participants