Format DateTime in Kendo UI Grid using asp.net MVC Wrapper

前端 未结 8 531
执念已碎
执念已碎 2021-02-01 14:38

I want to build a Kendo UI Grid with format date dd//MM/yyyy. However, all questions that I found about this, it were resolved with code Format(\"{0:d}\");. So,

8条回答
  •  星月不相逢
    2021-02-01 15:17

    Thanks for your answers:

    I format a duration in seconds in HH:MM:SS in a Kendo grid column using a ClientTemplate and calling a javascript function:

                    .ClientTemplate("#= secToHHMMSS(DurationInSeconds) # ")
                        .Title("Duration")
                        .Width(150);

    function secToHHMMSS(s) {
        f = Math.floor;
        g = (n) => ('00' + n).slice(-2);
        return f(s / 3600) + ':' + g(f(s / 60) % 60) + ':' + g(s % 60)
    }

提交回复
热议问题