hugo-theme-introduction/assets/js/initMoment.js

12 lines
328 B
JavaScript
Raw Normal View History

2018-07-18 15:40:58 +00:00
$(document).ready(function() {
const tnode = $("#time")
const update_localtime = function(){
var time = moment()
.tz(tnode.attr("data-time-zone"))
.format(tnode.attr("data-time-format"));
tnode.html(time);
}
update_localtime();
setInterval(update_localtime, 1000);
2018-07-18 15:40:58 +00:00
})