Datepicker setDate

2 posts, 0 answers
  1. guo yabin
    guo yabin avatar
    1 posts
    Member since:
    Aug 2009

    Posted 25 Aug 2009 Link to this post

    Hi everyone,

    If found something strange about the way setDate behaves when passing a date object in parameter.

    I use the fonction like this:
    var date = new Date();
    alert(date); // Tue Aug 25 2009 16:58:26 CTU+0800
    $('#datepicker).datepicker('setDate', date);
    alert(date); // Tue Aug 25 2009 16:58:57 CTU+0800

    Why does the setDate function modifies the date object? Is this normal?
    How to modifiy format of the date ,eg 'yy-MM-dd'?
    I didn't find anything about this subject on the website.

    Thanks a lot
  2. Veli
    Veli avatar
    2002 posts

    Posted 27 Aug 2009 Link to this post

    Hello guo yabin,

    Try with the RadDatePicker client API directly:


    where RadDatePicker1 is the ID of the picker.

    All the best,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top