Read the statement by Michael Teeuw here.
calendar module - format today events with time
-
Hi,
I would like to format the calendar events of today and tomorrow relatively with time. All other events should be formatted in the form “ddd, D.MMM, HH:mm”.
In the new version there is a new config option showTimeToday with which I should be able to do this. But I don’t get along with it and need help.
The events should be displayed like this for example:appointment-1 Heute, 18:00 appointment-2 Morgen, 14:00 appointment-3 Mo, 30.Okt, 09:00
my config is
{ module: "calendar", header: "Nächste Termine ", position: "top_left", config: { fetchInterval: 600000, // 10 Minuten calendars: [ { /* Kalender Paula */ symbol: "female", url: "....ics" }, { /* Kalender Sepp */ symbol: "male", url: "....ics" }, ], maxTitleLength: 21, wrapEvents: false, dateFormat: "ddd, D.MMM, HH:mm", fullDayEventDateFormat: "ddd, D.MMM", timeFormat: "absolute", getRelative: 12, urgency: 0, showEnd: false, maximumEntries: 6, fade: false, hidePrivate: false, nextDaysRelative: true, sliceMultiDayEvents: false, showTimeToday: true, } },
Many thanks for any help.
Many greetings
Sepp -
@spitzlbergerj generally in absolute mode, urgency (days NOT HOURS) is used to create a window of time to still show relative timed events
but you have it set to 0
timeFormat: "absolute", getRelative: 12, urgency: 0,
showTimeToday does the reverse…
in relative mode forces today’s events to NOT be relative. only for today, no other time window
get relative is used in relative mode for AN hour based time window
-
@sdetweil Thank you for the quick reply.
IfI seturgency: 1
then an appointment for today is displayed like this
Test appointment in 4 hours
but I would like to have the display
Test appointment today, 17:00
how can I achieve this?
thanks
Josef -
@spitzlbergerj , das nervt mich auch schon länger. Vielleicht gibt es ja eine Lösung. - …this has been bothering me for a long time. Maybe there is a solution.
-
@spitzlbergerj according to the code
showTimeToday must be false, and dateFornat must be ‘relative’, not absolute
-
@sdetweil Thanks again for your answer. But that unfortunately still does not do the whole job
config:
maxTitleLength: 21, wrapEvents: false, dateFormat: "ddd, D.MMM, HH:mm", fullDayEventDateFormat: "ddd, D.MMM", timeFormat: "relative", getRelative: 12, urgency: 1, showEnd: false, maximumEntries: 6, fade: false, hidePrivate: false, nextDaysRelative: true, sliceMultiDayEvents: false, showTimeToday: false,
result:
I actually just want the display like with timeformat: “absolute”. Only that with the current day simply “Today” is indicated and the same perhaps also with “Tomorrow”.
desired result:
Unfortunately I am too little experienced in coding the MagicMirror programs. Otherwise I would suggest a change for this, if the behavior is not achievable with the current settings.
Could you, dear @sdetweil, do that? Thanks a lot
Josef
-
@spitzlbergerj no way without significant code changes… sorry
you can ‘most’ of the way there with
timeFormat: "relative", getRelative: 1, showTimeToday: false,
1st is full day
2nd is upcoming in 3 hours -
@sdetweil Thanks a lot for your help! I’ll try it in this way