mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Change formatting. #181
This commit is contained in:
parent
9c9e93974e
commit
8adb16e1f6
@ -48,8 +48,9 @@ Module.register("clock",{
|
|||||||
secondsWrapper.className = "dimmed";
|
secondsWrapper.className = "dimmed";
|
||||||
|
|
||||||
// Set content of wrappers.
|
// Set content of wrappers.
|
||||||
|
var format = (this.config.timeFormat === 24) ? "HH:mm" : "hh:mm a";
|
||||||
dateWrapper.innerHTML = moment().format("dddd, LL");
|
dateWrapper.innerHTML = moment().format("dddd, LL");
|
||||||
timeWrapper.innerHTML = moment().format((this.config.timeFormat === 24) ? "HH:mm" : ("hh:mm"));
|
timeWrapper.innerHTML = moment().format(format);
|
||||||
secondsWrapper.innerHTML = moment().format("ss");
|
secondsWrapper.innerHTML = moment().format("ss");
|
||||||
|
|
||||||
// Combine wrappers.
|
// Combine wrappers.
|
||||||
|
@ -201,18 +201,14 @@ Module.register("currentweather",{
|
|||||||
var now = moment();
|
var now = moment();
|
||||||
var sunrise = moment(data.sys.sunrise * 1000);
|
var sunrise = moment(data.sys.sunrise * 1000);
|
||||||
var sunset = moment(data.sys.sunset * 1000);
|
var sunset = moment(data.sys.sunset * 1000);
|
||||||
|
var format = (this.config.timeFormat === 24) ? "HH:mm" : "hh:mm a";
|
||||||
|
|
||||||
if (sunrise < now && sunset > now) {
|
if (sunrise < now && sunset > now) {
|
||||||
if (sunrise.isValid()) {
|
this.sunriseSunsetTime = sunset.format(format);
|
||||||
this.sunriseSunsetTime = sunset.format((this.config.timeFormat === 24) ? "HH:mm" : "hh:mm a");
|
|
||||||
}
|
|
||||||
this.sunriseSunsetIcon = "wi-sunset";
|
this.sunriseSunsetIcon = "wi-sunset";
|
||||||
} else {
|
} else {
|
||||||
if (sunset.isValid()) {
|
this.sunriseSunsetTime = sunrise.format(format);
|
||||||
this.sunriseSunsetTime = sunrise.format((this.config.timeFormat === 24) ? "HH:mm" : "hh:mm a");
|
|
||||||
}
|
|
||||||
this.sunriseSunsetIcon = "wi-sunrise";
|
this.sunriseSunsetIcon = "wi-sunrise";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user