Cleanup clock jsdoc

This commit is contained in:
rejas 2020-07-30 09:36:01 +02:00
parent e489b7101c
commit 90cca28e01

View File

@ -153,8 +153,11 @@ Module.register("clock", {
} }
/** /**
* @param config * Format the time according to the config
* @param time *
* @param {object} config The config of the module
* @param {object} time time to format
* @returns {string} The formatted time string
*/ */
function formatTime(config, time) { function formatTime(config, time) {
var formatString = hourSymbol + ":mm"; var formatString = hourSymbol + ":mm";
@ -163,6 +166,7 @@ Module.register("clock", {
} }
return moment(time).format(formatString); return moment(time).format(formatString);
} }
if (this.config.showSunTimes) { if (this.config.showSunTimes) {
const sunTimes = SunCalc.getTimes(now, this.config.lat, this.config.lon); const sunTimes = SunCalc.getTimes(now, this.config.lat, this.config.lon);
const isVisible = now.isBetween(sunTimes.sunrise, sunTimes.sunset); const isVisible = now.isBetween(sunTimes.sunrise, sunTimes.sunset);