datepicker doesn't show initially value (angular)

10 posts, 0 answers
  1. Andrey
    Andrey avatar
    3 posts
    Member since:
    Mar 2014

    Posted 10 Sep 2015 Link to this post

    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.
  2. Andrey
    Andrey avatar
    3 posts
    Member since:
    Mar 2014

    Posted 10 Sep 2015 Link to this post

    Was fixed.
  3. Kendo UI is VS 2017 Ready
  4. Ryan
    Ryan avatar
    5 posts
    Member since:
    Jun 2015

    Posted 28 Sep 2015 Link to this post

    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" />

     ​

  5. Andrey
    Andrey avatar
    3 posts
    Member since:
    Mar 2014

    Posted 28 Sep 2015 Link to this post

    add also ng-model="vmDate" where vmDate = kendo.toString($scope.vm.dateTime, 'u')
  6. Ryan
    Ryan avatar
    5 posts
    Member since:
    Jun 2015

    Posted 28 Sep 2015 Link to this post

    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" />

     

     

  7. Ryan
    Ryan avatar
    5 posts
    Member since:
    Jun 2015

    Posted 28 Sep 2015 Link to this post

    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.
  8. Ryan
    Ryan avatar
    5 posts
    Member since:
    Jun 2015

    Posted 28 Sep 2015 Link to this post

    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?
  9. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 30 Sep 2015 Link to this post

    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!
     
  10. Mike
    Mike avatar
    1 posts
    Member since:
    Dec 2014

    Posted 06 Oct 2015 in reply to Kiril Nikolov Link to this post

    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?

  11. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 08 Oct 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready