var time = { timeFormat: config.time.timeFormat || 24, dateLocation: '.date', timeLocation: '#time', updateInterval: 1000, intervalId: undefined, displaySeconds: (typeof config.time.displaySeconds == 'undefined') ? true : config.time.displaySeconds, digitFade: (typeof config.time.digitFade == 'undefined') ? false : config.time.digitFade, }; /** * Updates the time that is shown on the screen */ time.updateTime = function () { var timeLocation = this.timeLocation; var _now = moment(); var _date = _now.format('[]dddd,[ ]LL[]'); $(this.dateLocation).updateWithText(_date, 1000); $('.fade').removeClass('fade') var html = '' if (this.displaySeconds) { html = _now.format(this._timeFormat+':mm').replace(/./g, '$&') + '' + _now.format('ss').replace(/./g, '$&') + ''; if (typeof this.intervalId == 'undefined') { this.intervalId = setInterval(function () { this.updateTime(); }.bind(this), this.updateInterval); } } else { html = _now.format(this._timeFormat+':mm').replace(/./g, '$&'); if (this.intervalId) { clearInterval(this.intervalId); this.intervalId = undefined; } seconds = 60 - (new Date()).getSeconds(); setTimeout(function () { this.updateTime(); }.bind(this), seconds*1000); } if (this.digitFade) { var diff = $('