Read the statement by Michael Teeuw here.
Calendar - Change DateFormat to DD MM YYY
-
Hello,
just starting out with the MagicMirror and doing my first steps with it. One thing I am struggling with is to change the date format, when it is set to “relative”. There I get MM DD YYYY but I would like to have DD MM YYYY.When changing to absolute I can freely adjust the format. Is there any trick where / how I can do this with the relative format?
Here is a look at my config.js:
{ module: "calendar", header: "...", position: "bottom_right", config: { fade : true, timeFormat: "relative", dateFormat: "DD/MM/YYYY - HH:mm", calendars: [ { symbol: "calendar-check-o", url: "..." } ] }, },
-
Hi,
The default in the .js is dateFormat: “MMM Do”, for fun have you tried “Do MMM”?
Cheers.
-
@runny to chnage the date formats, you also need to specify
timeFormat:'absolute',
-
Hello scumbelly and sdetweil,
Thanks for your help and quick responses here! I have tried what you have suggested scumbelly but with no result. As sdetweil indicates the dateFormat does only change, when you specify timeFormat as absolute.
And that is kind of my problem…I can change the dateFormat but only when switching to absolute. But for the latest appointments I’d prefer to have it in relative format. As I understand it this should be possible also by using the “urgency” and “getRelative” variables but then I run into another problem - the relative date that is shown is different than when I have timeFormat as relative (no days, no times).
I have attached two pictures marking what I’d like to have (green) and what I’d not like to have (red) and hope this explains what I want to achieve:
-
@runny yes, I understand. However, the code doesn’t support that.
it’s
relative and no user specified formats,
or
absolute and user specified formats -
Hi, I’ve also tried to achieve it, but due to differences in grammar in different languages support of relative calendar customization is a little bit tricky, so maintainers decided not to accept my change (more details here).
However, if you’re willing to do it, you can create a fork from the original repository on the github, and then pull my changes from this branch containing my changes. Depending on what exactly you’re trying to achieve, you might need to do some further tinkering with the calendar.js, because this solution was tailored for my needs and I was focusing on full day events, but there’s a fullDayEventDateFormat config option that might help you.