diff --git a/MMM-todo.js b/MMM-todo.js index aaaa825..77bff16 100644 --- a/MMM-todo.js +++ b/MMM-todo.js @@ -4,18 +4,15 @@ Module.register("MMM-todo", { }, start: function() { - var self = this - setTimeout(function() { - self.dailyUpdate() - }, self.getTimeToMidnight() - new Date()) + this.doUpdate() }, - dailyUpdate: function() { + doUpdate: function() { var self = this self.updateDom() setTimeout(function() { - self.dailyUpdate() - }, self.getTimeToMidnight()) + self.doUpdate() + }, 5 * 60 * 1000) }, getDom: function() { @@ -52,12 +49,6 @@ Module.register("MMM-todo", { return ty + tm + td }, - getTimeToMidnight() { - var timeToMidnight = new Date() - timeToMidnight.setHours(24, 0, 0, 0) - return timeToMidnight - }, - getCheckbox: function(label, id) { var container = document.createElement("label") container.className = "todo-container" @@ -87,4 +78,4 @@ Module.register("MMM-todo", { getStyles: function() { return [this.file("MMM-todo.css")] } -}) +}) \ No newline at end of file