bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

ngModel Non Standard Date Formats

Open acgentry opened this issue 12 years ago • 2 comments

Hi there, wanted to start up a new thread than #973, since it may not be exactly the same problem. The solution that was provided in that issue for using a parser to store the value on the model doesn't work for non standard string formats like "yyyyMMdd" for a date. I took the solution plunk and created a new one:

http://plnkr.co/edit/yb7AlE?p=preview

This issue is that the injection of a parser into the pipeline doesn't look like its in the $parsers chain of the calendar control with this myformat and errors will come up as such:

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.

I believe that in the example from #973 it is able to interpret the model as a standard date format.

Regards

acgentry avatar Nov 07 '14 16:11 acgentry

Before investigating this, I noticed you're using quite an old version of UI Bootstrap and AngularJS. Have you tried this with the latest version of UI Bootstrap? Could you create a Plunker for the latest version instead?

We still don't support AngularJS 1.3, so the latest 1.2.x versions should do.

chrisirhc avatar Nov 07 '14 17:11 chrisirhc

Closing due to inactivity. Please feel free to re-open once you've tested with the latest UI Bootstrap 0.13 and Angular JS 1.3 and can confirm this is still an issue.

rvanbaalen avatar May 31 '15 21:05 rvanbaalen