mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-07 16:11:14 +00:00
Merge pull request #2451 from TheDuffman85/develop
This commit is contained in:
commit
d874ad9988
@ -18,6 +18,7 @@ _This release is scheduled to be released on 2021-04-01._
|
||||
- Added logging when using deprecated modules weatherforecast or currentweather.
|
||||
- Portuguese translations for "MODULE_CONFIG_CHANGED" and PRECIP.
|
||||
- Respect parameter ColoredSymbolOnly also for custom events
|
||||
- Added a new parameter to hide time portion on relative times
|
||||
|
||||
### Updated
|
||||
|
||||
|
@ -36,6 +36,7 @@ Module.register("calendar", {
|
||||
fadePoint: 0.25, // Start on 1/4th of the list.
|
||||
hidePrivate: false,
|
||||
hideOngoing: false,
|
||||
hideTime: false,
|
||||
colored: false,
|
||||
coloredSymbolOnly: false,
|
||||
customEvents: [], // Array of {keyword: "", symbol: "", color: ""} where Keyword is a regexp and symbol/color are to be applied for matched
|
||||
@ -366,7 +367,17 @@ Module.register("calendar", {
|
||||
// Show relative times
|
||||
if (event.startDate >= now) {
|
||||
// Use relative time
|
||||
if (!this.config.hideTime) {
|
||||
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").calendar());
|
||||
} else {
|
||||
timeWrapper.innerHTML = this.capFirst(
|
||||
moment(event.startDate, "x").calendar(null, {
|
||||
sameDay: "[Today]",
|
||||
nextDay: "[Tomorrow]",
|
||||
nextWeek: "dddd"
|
||||
})
|
||||
);
|
||||
}
|
||||
if (event.startDate - now < this.config.getRelative * oneHour) {
|
||||
// If event is within getRelative hours, display 'in xxx' time format or moment.fromNow()
|
||||
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
|
||||
|
Loading…
x
Reference in New Issue
Block a user