Custom date formatting in grid column

2 posts, 0 answers
  1. Steve
    Steve avatar
    35 posts
    Member since:
    Apr 2015

    Posted 03 Sep 2015 Link to this post

    Hi All,

     

    I have a function that grab the specific date format from a config file,  but the code below output the wrong date format.  Could anyone tell me what what I'm missing or did wrong?

     

    columns:[

         { title: "Date", field: "tDate", width: 190, template: '#= kendo.toString(tDate,  getMyFormattedDate()) #' }

    ];

     result is always Tue Jul 28 2015 13:01:36 GMT-0600 (Mountain Daylight Time) and the format from getMyFormattedDate is set as 'MM-dd-yyyy'.

     

    TIA

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1803 posts

    Posted 04 Sep 2015 Link to this post

    Hello Steve,

    I am not sure why the format is failing to be applied in your scenario, but you can refer to the following dojo example which works correctly:
    Please note that you will also have to set the type of the column to "date".

    Hope this helps.


    Regards,
    Konstantin Dikov
    Telerik
     
    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
Back to Top