depth year last day of month

3 posts, 1 answers
  1. Francesco
    Francesco avatar
    6 posts
    Member since:
    Feb 2012

    Posted 14 Jan 2013 Link to this post

    Hi,
    i have create a datetimepicker, i put depth: year
    i want that when i select the month in the value appear the last day of the selected month and not the first day..

    i select Jan   value: 01/01/2013  so i want that when i select a month in the value there is  31/01/2013  <- so the last day.

    somebody know how to do?

    Thank you
  2. Answer
    Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2593 posts

    Posted 16 Jan 2013 Link to this post

    Hi Francesco,

    I have already answered your support ticket on the same subject, however I am pasting my reply here so the other users who are interested in the same can read it:  

    I am afraid what you are trying to achieve is not supported in Kendo UI Date/TimePickers and its implementation requires additional code. As a possible approach you can hook up to the change event of the widgets, calculate the last day of the month and set the new date.

    Kind regards,
    Iliana Nikolova
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Francesco
    Francesco avatar
    6 posts
    Member since:
    Feb 2012

    Posted 16 Jan 2013 Link to this post

    Thank you very much.. 

    if someone need a code the solution is:

    $("#data-a-copertura").kendoDatePicker({
    //....,
    change: function () {
    var date = this.value();
    date.setDate(new Date(date.getFullYear(), date.getMonth()+1, 0).getDate());
    this.value = date  //or put this.set("bindname", date); if you use a data-bind.
    }
    });
Back to Top