Globalization issue while Date Formating

4 posts, 1 answers
  1. James
    James avatar
    8 posts
    Member since:
    Nov 2011

    Posted 18 Apr 2012 Link to this post

    Hello,
    I am facing issue while formating string date to right format.
    Following is my code:

    return kendo.toString(new Date(2010,04,17), "MM/dd/yyyy");<BR>

    It return me date as 05/17/2010

    So it as adding a day in result, I am not setting any specific culture as I want Kendo to check my current thread cluture and use it for conversion.

    Can someone please let me know the cause behind this?

  2. Answer
    Wannes
    Wannes avatar
    12 posts
    Member since:
    Oct 2011

    Posted 19 Apr 2012 Link to this post

    Hi James,

    The problem here is that the JavaScript Date object expects a month value between 0 and 11, not 1 and 12.

    Cheers,
    Wannes.
  3. Kendo UI is VS 2017 Ready
  4. James
    James avatar
    8 posts
    Member since:
    Nov 2011

    Posted 19 Apr 2012 Link to this post

    Oh ok got it :)
    Thanks.
Back to Top
Kendo UI is VS 2017 Ready