使用Kendo UI显示滴答时间

时间:2017-01-06 15:10:07

标签: kendo-ui

我想知道是否有任何Kendo UI元素可以在网页中显示时间,例如Microsoft Windows右下角的计时器显示,但显示的是秒数。

1 个答案:

答案 0 :(得分:1)

实际上@Sean所说的是真的,没有用于此类任务的小部件。但是,您可以使用名为toString()的令人敬畏的Kendo UI方法来格式化时间并由您自己显示。这很容易,根本不需要jQuery:

<div id="timer"></div>

var timer = document.getElementById("timer");

window.setInterval(function() {
    timer.innerText = kendo.toString((new Date()), 'HH:mm:ss');
}, 1000);

Demo

检查this doc格式参考。