-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[Date picker] Calendar is not rendering when model is a timestamp #5191
Comments
There was a breaking change made a couple of releases ago where we decided we only want to support usage of a Date instance due to various issues & complexity supporting multiple formats. This Plunker works fine if it is a date object, as seen here. |
Strange... It was working fine before this.render = function() {
if (ngModelCtrl.$viewValue) {
var date = new Date(ngModelCtrl.$viewValue),
isValid = !isNaN(date);
if (isValid) {
this.activeDate = dateParser.fromTimezone(date, ngModelOptions.timezone);
} else if (!$datepickerSuppressError) {
$log.error('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.');
}
}
this.refreshView();
}; |
There were a lot of changes made in the datepicker from 0.14.3 to 1.0.0, namely to support user-specified timezones of relevance here. I'll update the error string, sorry about the misreported message there. Edit: Looks like it is changed in 1.0.0 to |
The error highlighted is in But... The example in my plnkr was working fine with angular Here is the plnkr: |
Ah, I thought it was in the dateparser - I'll open a PR for this shortly. |
Still. Have a look on the last plnkr. Timestaps are working wit angular 1.4.8 |
We declared in release 0.13.2 that we are only supporting date objects, as seen here. Our documentation also declares only support for date objects - this is not going to change. |
Not pushing for a change. It seems a little bit weird that the error with angular 1.5 is more an uncatched error than an error throwed by the library. |
Calendar is not rendering when model is a timestamp. This issue happens only with angular 1.5 and only when the popup is opened first time.
http://plnkr.co/edit/i2y5RqCzvyro8O7NVryg?p=preview
The text was updated successfully, but these errors were encountered: