<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Calendar: Change format of relative times&#x2F;dates]]></title><description><![CDATA[<p dir="auto">I’d like to change the relative time format for Calendar entries from (e.g.) “Monday at 07:00” to “Mon 07:00” or similar. I’m using the standard “calendar” module.<br />
I’m using a small screen (Raspberry Pi touch screen) with MagicMirror and so have very limited screen real estate. As shown below, the “Monday at 07:00” takes up a good chunk of space, so I’d like to make the column as compact as possible…<br />
I’ve fiddled with various config entries but can find nothing that controls the “Monday at” part of the text.<br />
Any ideas?</p>
<p dir="auto"><img src="/assets/uploads/files/1601727942544-20089a38-aa0e-4055-9867-4ac0e9ffc3d1-image.png" alt="20089a38-aa0e-4055-9867-4ac0e9ffc3d1-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/topic/13762/calendar-change-format-of-relative-times-dates</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 12:38:21 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/13762.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 03 Oct 2020 12:34:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Calendar: Change format of relative times&#x2F;dates on Sat, 03 Oct 2020 17:56:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cokelid" aria-label="Profile: cokelid">@<bdi>cokelid</bdi></a> yes, same as the others</p>
]]></description><link>https://forum.magicmirror.builders/post/82750</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/82750</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 03 Oct 2020 17:56:19 GMT</pubDate></item><item><title><![CDATA[Reply to Calendar: Change format of relative times&#x2F;dates on Sat, 03 Oct 2020 17:33:43 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a>!<br />
So it’s the call to moment.calendar() as you suggested. I changed calendar.js (line 339) to pass in a customised format:</p>
<pre><code>calFormat = {
	sameDay: 'LT',
	nextDay: 'ddd[,] LT',
	nextWeek: 'ddd[,] LT',
	lastDay: '[Yesterday]',
	lastWeek: '[Last] ddd',
	sameElse: 'DD/MM/YYYY'
};
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").calendar(null, calFormat));			
</code></pre>
<p dir="auto">Presumably I could easily pull that format in from <code>this.config</code>?</p>
]]></description><link>https://forum.magicmirror.builders/post/82748</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/82748</guid><dc:creator><![CDATA[cokelid]]></dc:creator><pubDate>Sat, 03 Oct 2020 17:33:43 GMT</pubDate></item><item><title><![CDATA[Reply to Calendar: Change format of relative times&#x2F;dates on Sat, 03 Oct 2020 13:58:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cokelid" aria-label="Profile: cokelid">@<bdi>cokelid</bdi></a> there are two hard coded moment() formats</p>
<p dir="auto">fromNow()<br />
and<br />
calendar()</p>
]]></description><link>https://forum.magicmirror.builders/post/82735</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/82735</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 03 Oct 2020 13:58:47 GMT</pubDate></item><item><title><![CDATA[Reply to Calendar: Change format of relative times&#x2F;dates on Sat, 03 Oct 2020 13:54:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cokelid" aria-label="Profile: cokelid">@<bdi>cokelid</bdi></a> one left. timeFormat</p>
]]></description><link>https://forum.magicmirror.builders/post/82734</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/82734</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 03 Oct 2020 13:54:07 GMT</pubDate></item><item><title><![CDATA[Reply to Calendar: Change format of relative times&#x2F;dates on Sat, 03 Oct 2020 13:47:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> said in <a href="/post/82730">Calendar: Change format of relative times/dates</a>:</p>
<blockquote>
<p dir="auto">dateFormat: “MMM Do”,<br />
dateEndFormat: “LT”,<br />
fullDayEventDateFormat: “MMM Do”,</p>
</blockquote>
<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a>, I appreciate the speedy response! I have given that a go but they don’t affect the “Monday at 07:00” at all?</p>
]]></description><link>https://forum.magicmirror.builders/post/82733</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/82733</guid><dc:creator><![CDATA[cokelid]]></dc:creator><pubDate>Sat, 03 Oct 2020 13:47:06 GMT</pubDate></item><item><title><![CDATA[Reply to Calendar: Change format of relative times&#x2F;dates on Sat, 03 Oct 2020 12:52:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cokelid" aria-label="Profile: cokelid">@<bdi>cokelid</bdi></a> there are 4 time formatting options</p>
<pre><code>		timeFormat: "relative",
		dateFormat: "MMM Do",
		dateEndFormat: "LT",
		fullDayEventDateFormat: "MMM Do",
</code></pre>
<p dir="auto">and here are the meanings<br />
<a href="https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/01-format/" target="_blank" rel="noopener noreferrer nofollow ugc">https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/01-format/</a></p>
]]></description><link>https://forum.magicmirror.builders/post/82730</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/82730</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 03 Oct 2020 12:52:19 GMT</pubDate></item></channel></rss>