-
Notifications
You must be signed in to change notification settings - Fork 203
ui-date-format error in angular 1.3.0-rc.4 #96
Comments
Still an issue in |
Still an issue in |
A quick fix that works for me at the moment is to replace "modelCtrl.$formatters.push" with "modelCtrl.$formatters.unshift". |
Related: angular/angular.js#9218 Not sure why this matters, though, uiDateFormat is expecting a string anyway. Edit - Oh, I guess it's because angular runs the formatters backwards (as mentioned in that issue thread)? That's why using unshift works. |
@giannisp cool! 👍 |
I believe this is fixed by what I have done in this pull request #94 does it work for you? |
Here's another option, just remove the default formatter: https://github.com/justinwinslow/ui-date/blob/master/src/date.js#L90 |
I am also experiencing this issue and PR #94 resolves the issue for me. I am using angularjs 1.3.0 |
This is a blocking issue for me when upgrading my application to 1.3.0 😭 |
I don't believe PR #94 works. I'm using moment to generate a Date object like: How I construct the date with moment has worked with ui-date from 1.0.X through 1.3.0-rc's. Other suggestions? |
@giannisp's fix worked for me, too. Has anyone thought to make a PR with this change? |
Hi @CWSpear I've incorporated that along with another set of fixes in #99 and at least it passes the tests and works for the cases that I have. @nathasm, I haven't added a test case for moment integration but perhaps #99 with fixes from giannisp will also help. If it doesn't work, perhaps a small jsbin with your case could help us find out what is wrong. |
After spending some time investigating, it appears that my issue was with the version of jquery-ui I was using: 1.8.16. Not sure why the angular upgrade would expose this, but I've upgrading jquery-ui and my issue has been resolved. |
"Error: ng-Model value must be a Date object - currently it is a string - use ui-date-format to convert it from a string"
Markup:
Wasn't an issue in 1.3.0-rc.3
The text was updated successfully, but these errors were encountered: