Update more frequently

This commit is contained in:
2021-01-12 09:53:58 -06:00
parent 40d953f216
commit 1789fe7c23

View File

@ -4,18 +4,15 @@ Module.register("MMM-todo", {
}, },
start: function() { start: function() {
var self = this this.doUpdate()
setTimeout(function() {
self.dailyUpdate()
}, self.getTimeToMidnight() - new Date())
}, },
dailyUpdate: function() { doUpdate: function() {
var self = this var self = this
self.updateDom() self.updateDom()
setTimeout(function() { setTimeout(function() {
self.dailyUpdate() self.doUpdate()
}, self.getTimeToMidnight()) }, 5 * 60 * 1000)
}, },
getDom: function() { getDom: function() {
@ -52,12 +49,6 @@ Module.register("MMM-todo", {
return ty + tm + td return ty + tm + td
}, },
getTimeToMidnight() {
var timeToMidnight = new Date()
timeToMidnight.setHours(24, 0, 0, 0)
return timeToMidnight
},
getCheckbox: function(label, id) { getCheckbox: function(label, id) {
var container = document.createElement("label") var container = document.createElement("label")
container.className = "todo-container" container.className = "todo-container"
@ -87,4 +78,4 @@ Module.register("MMM-todo", {
getStyles: function() { getStyles: function() {
return [this.file("MMM-todo.css")] return [this.file("MMM-todo.css")]
} }
}) })