mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-03 22:36:09 +00:00
poinst of time when calendar event gets relative now customizable
This commit is contained in:
parent
c1b8fc1233
commit
8f4effbb8d
@ -23,6 +23,7 @@ Module.register("calendar",{
|
|||||||
fade: true,
|
fade: true,
|
||||||
urgency: 7,
|
urgency: 7,
|
||||||
timeFormat: "relative",
|
timeFormat: "relative",
|
||||||
|
getRelative: '6',
|
||||||
fadePoint: 0.25, // Start on 1/4th of the list.
|
fadePoint: 0.25, // Start on 1/4th of the list.
|
||||||
calendars: [
|
calendars: [
|
||||||
{
|
{
|
||||||
@ -179,7 +180,7 @@ Module.register("calendar",{
|
|||||||
if (event.startDate >= new Date()) {
|
if (event.startDate >= new Date()) {
|
||||||
if (event.startDate - now < 2 * one_day) {
|
if (event.startDate - now < 2 * one_day) {
|
||||||
// This event is within the next 48 hours (2 days)
|
// This event is within the next 48 hours (2 days)
|
||||||
if (event.startDate - now < 6 * one_hour) {
|
if (event.startDate - now < this.config.getRelative * one_hour) {
|
||||||
// If event is within 6 hour, display 'in xxx' time format or moment.fromNow()
|
// If event is within 6 hour, display 'in xxx' time format or moment.fromNow()
|
||||||
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
|
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user