mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Don't display 'in xxx' for all day events when using relative times
This commit is contained in:
parent
46b63f52fe
commit
1af282a7a1
@ -368,7 +368,7 @@ Module.register("calendar", {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Show relative times
|
// Show relative times
|
||||||
if (event.startDate >= now) {
|
if ((event.startDate >= now) || (event.fullDayEvent && event.today)) {
|
||||||
// Use relative time
|
// Use relative time
|
||||||
if ((!this.config.hideTime) && (!event.fullDayEvent)) {
|
if ((!this.config.hideTime) && (!event.fullDayEvent)) {
|
||||||
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").calendar(null, { sameElse: this.config.dateFormat }));
|
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").calendar(null, { sameElse: this.config.dateFormat }));
|
||||||
@ -382,10 +382,7 @@ Module.register("calendar", {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (event.startDate - now < this.config.getRelative * oneHour) {
|
if (event.fullDayEvent) {
|
||||||
// If event is within getRelative hours, display 'in xxx' time format or moment.fromNow()
|
|
||||||
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
|
|
||||||
} else if (event.fullDayEvent) {
|
|
||||||
// Full days events within the next two days
|
// Full days events within the next two days
|
||||||
if (event.today) {
|
if (event.today) {
|
||||||
timeWrapper.innerHTML = this.capFirst(this.translate("TODAY"));
|
timeWrapper.innerHTML = this.capFirst(this.translate("TODAY"));
|
||||||
@ -396,8 +393,10 @@ Module.register("calendar", {
|
|||||||
timeWrapper.innerHTML = this.capFirst(this.translate("DAYAFTERTOMORROW"));
|
timeWrapper.innerHTML = this.capFirst(this.translate("DAYAFTERTOMORROW"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (event.startDate - now < this.config.getRelative * oneHour) {
|
||||||
} else {
|
// If event is within getRelative hours, display 'in xxx' time format or moment.fromNow()
|
||||||
|
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
|
||||||
|
} } else {
|
||||||
// Ongoing event
|
// Ongoing event
|
||||||
timeWrapper.innerHTML = this.capFirst(
|
timeWrapper.innerHTML = this.capFirst(
|
||||||
this.translate("RUNNING", {
|
this.translate("RUNNING", {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user