Add dateFormat to calendar module

This commit is contained in:
Chris van Marle
2016-11-10 17:26:29 +01:00
parent a388fe3acb
commit 9fd81bf6c7
2 changed files with 10 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ Module.register("calendar", {
fade: true,
urgency: 7,
timeFormat: "relative",
dateFormat: "MMM Do",
getRelative: 6,
fadePoint: 0.25, // Start on 1/4th of the list.
calendars: [
@@ -175,7 +176,7 @@ Module.register("calendar", {
// This event falls within the config.urgency period that the user has set
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
} else {
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format("MMM Do"));
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.dateFormat));
}
} else {
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
@@ -205,7 +206,7 @@ Module.register("calendar", {
// This event falls within the config.urgency period that the user has set
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
} else {
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format("MMM Do"));
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.dateFormat));
}
} else {
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());