This is a migrated thread and some comments may be shown as answers.

datepicker doesn't show initially value (angular)

11 Answers 395 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Andrey
Top achievements
Rank 1
Andrey asked on 10 Sep 2015, 12:18 PM
I'm using this example http://demos.telerik.com/kendo-ui/datepicker/angular. If I try to set initial values for dateString and/or dateObject datepicker doesn't show this initial value.

11 Answers, 1 is accepted

Sort by
0
Andrey
Top achievements
Rank 1
answered on 10 Sep 2015, 12:55 PM
Was fixed.
0
Ryan
Top achievements
Rank 1
answered on 28 Sep 2015, 03:39 PM

Any ideas on how this was fixed? I'm having the same issue. AngularJS, newest KendoUI download, code below. vm.dateTime is an isodate, don't know if that causes issues.

<input kendo-date-time-picker k-ng-model="vm.dateTime" />

 â€‹

0
Andrey
Top achievements
Rank 1
answered on 28 Sep 2015, 04:09 PM
add also ng-model="vmDate" where vmDate = kendo.toString($scope.vm.dateTime, 'u')
0
Ryan
Top achievements
Rank 1
answered on 28 Sep 2015, 04:27 PM

Thank Audrey! I'm using Typescript so in my API call to my resource, on success I put that code in and it works! For future people, this is what it generally looks like.

 this._$scope.vm = this;

    this._​someResource.​myResource.get({
                org: this.orgId
            }, angular.bind(this, (​someSchedule: ​any) => {
                this.​someSchedule = ​someSchedule;
                ​_$scope.vmDate = kendo.toString(​_$scope​.someSchedule.​dateTime, 'u');
            }),
            (response: any) => {
                console.log("Fail: get");
            });​

 

and in the view I had <input id="datetimepicker-runOnce" kendo-date-time-picker k-ng-model="vm.​someSchedule.dateTime" ng-model="vmDate" />

 

 

0
Ryan
Top achievements
Rank 1
answered on 28 Sep 2015, 07:02 PM
As a side note, the reason I needed this work around is because I created a typescript model ​declaring .someSchedule.​dateTime as a type :Date. This directive requires a string and therefore me changing the dateTime: type to string or any would also fix this issue.
0
Ryan
Top achievements
Rank 1
answered on 28 Sep 2015, 09:05 PM
Spoke too soon. The date is working but the Time comes up as midnight no matter what I do. I tried pushing in ISO 8601 date strings and it doesn't appear to like them. I also tried using the parseDate function and it didn't like that either. Any ideas?
0
Kiril Nikolov
Telerik team
answered on 30 Sep 2015, 09:00 AM

Hello Ryan,

 

I am afraid that the issue is not a known one, nor is reproducible in our online demos, so please extract a runnable sample in a Kendo UI Dojo and we will be happy to help.

 

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Mike
Top achievements
Rank 1
answered on 06 Oct 2015, 10:07 PM

http://demos.telerik.com/kendo-ui/datetimepicker/angular

 This problem is still present in the online demos. I cannot get the field to initialize properly. Can someone give me a workaround for it?

0
Kiril Nikolov
Telerik team
answered on 08 Oct 2015, 08:19 AM

Hello Mike,

 

Is this the issue that you are referring to:

 

https://github.com/telerik/kendo-ui-core/issues/1155

 

If this is the case, then please note that the issue is resolved and the fix will be available with the next release.

 

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
kdubious
Top achievements
Rank 1
answered on 30 Nov 2017, 10:27 PM

The issue is still there:

https://www.telerik.com/kendo-angular-ui/components/dateinputs/datepicker/

Click Run Code under the Date Ranges example.

There's a value set in the model, but the UI doesn't show it.

 

Removing the #someID="ngmodel" & [(ngModel)]="value" and adding [(value)] fixes that issue, but then you lose the ability to read the errors from the ngModel.

 

Ideas?

0
Stefan
Telerik team
answered on 04 Dec 2017, 11:40 AM
Hello, Kevin,

Thank you for reporting this.

Please have in mind that this a forum for the Kendo UI for jQuery and the Angular in the name refers to AngularJS(1). The forum is from 2015 when Kendo UI for Angular 2+ was not released.

I will forward this to the relevant team for inspecting it.

Also, I can recommend submit a ticket for the Kendo UI for Angular 2+ product or to write a post in the dedicated forum:

https://www.telerik.com/forums/kendo-angular-ui

Also, the issue could be with the plunker as well, but the Angular 2+ team can provide more details:

https://github.com/telerik/kendo-angular/issues/1129

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Date/Time Pickers
Asked by
Andrey
Top achievements
Rank 1
Answers by
Andrey
Top achievements
Rank 1
Ryan
Top achievements
Rank 1
Kiril Nikolov
Telerik team
Mike
Top achievements
Rank 1
kdubious
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or