<?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 - wrong repeating count when using sliceMultiDayEvents]]></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>  I know that parsing ics is a pita, but before I submit an issue at github, I wanted to have a quick discussion here in the forum.</p>
<p dir="auto">When using the sliceMultiDayEvents config option the calendar shows an additional day. This is probably caused by the RRule parsing.</p>
<p dir="auto">The code that causes this starts <a href="https://github.com/MagicMirrorOrg/MagicMirror/blob/53fc814ff8ad5ad5f8289037c692bf28daa4378a/modules/default/calendar/calendar.js#L633" target="_blank" rel="noopener noreferrer nofollow ugc">here</a></p>
<p dir="auto"><img src="/assets/uploads/files/1726478435548-8fe0a0c7-3fec-4eac-bc4f-3af025845f30-image.png" alt="8fe0a0c7-3fec-4eac-bc4f-3af025845f30-image.png" class=" img-fluid img-markdown" /></p>
<pre><code>BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:Dirk Test
X-WR-TIMEZONE:Europe/Berlin
BEGIN:VEVENT
DTSTART;VALUE=DATE:20240918
DTEND;VALUE=DATE:20240919
DTSTAMP:20240916T084410Z
UID:2crbv1ijljc2kt9jclkgu5hqa0@google.com
CREATED:20240916T083831Z
LAST-MODIFIED:20240916T083831Z
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:1 day single
TRANSP:TRANSPARENT
END:VEVENT
BEGIN:VEVENT
DTSTART;VALUE=DATE:20240919
DTEND;VALUE=DATE:20240920
RRULE:FREQ=YEARLY
DTSTAMP:20240916T084410Z
UID:6gb19havnq6vp2qput51e5rmml@google.com
CREATED:20240916T083850Z
LAST-MODIFIED:20240916T083850Z
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:1 day repeat
TRANSP:TRANSPARENT
END:VEVENT
BEGIN:VEVENT
DTSTART;VALUE=DATE:20240920
DTEND;VALUE=DATE:20240922
DTSTAMP:20240916T084410Z
UID:06e9u1trbqi3jbvstvq4qqutau@google.com
CREATED:20240916T083902Z
LAST-MODIFIED:20240916T083902Z
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:2 day single
TRANSP:TRANSPARENT
END:VEVENT
BEGIN:VEVENT
DTSTART;VALUE=DATE:20240923
DTEND;VALUE=DATE:20240925
RRULE:FREQ=YEARLY
DTSTAMP:20240916T084410Z
UID:0ui78rk6hpcv8rmbb6nuonhmgg@google.com
CREATED:20240916T083919Z
LAST-MODIFIED:20240916T083919Z
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:2 day repeat
TRANSP:TRANSPARENT
END:VEVENT
END:VCALENDAR
</code></pre>
]]></description><link>https://forum.magicmirror.builders/topic/18984/calendar-wrong-repeating-count-when-using-slicemultidayevents</link><generator>RSS for Node</generator><lastBuildDate>Mon, 15 Jun 2026 17:21:59 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/18984.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 Sep 2024 09:20:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Thu, 17 Oct 2024 16:13:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marclandis" aria-label="Profile: MarcLandis">@<bdi>MarcLandis</bdi></a> I pushed a new branch</p>
<p dir="auto">here is an UPDATED test version of the fixes for all kinds of calendar date problems.</p>
<p dir="auto">NOTE: the changed branch name<br />
NOTE: this used the node-cal@0.19.0 library UNCHANGED</p>
<p dir="auto">best to make a new folder and git clone there</p>
<p dir="auto">git clone <a href="https://github.com/sdetweil/MagicMirror" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/sdetweil/MagicMirror</a><br />
cd MagicMirror<br />
git checkout fixcaldates2 // &lt;------ note this is a changed branch name<br />
npm run install-mm<br />
copy your config.js and custom.css from the prior folder<br />
and the non-default modules you have installed…</p>
<p dir="auto">this ONLY changes the default calendar<br />
but DOES ship an updated node-ical library too</p>
<p dir="auto">if you need to fall back, just rename the folders around again so that<br />
your original is called MagicMirror</p>
<p dir="auto">all the testcases for node-ical and MagicMirror execute successfully.</p>
<p dir="auto">the ‘BIG’ change here is to get the local NON-TZ dates for the<br />
rrule.between()</p>
<p dir="auto">all the checking and conversion code is commented out or not used<br />
the node-ical fixes are for excluded dates (exdate) values being adjusted for DST/STD time… waiting to submit that PR</p>
<p dir="auto">one fix in calendar.js for checking if a past date was too far back,<br />
but it never checked to see IF the event date was in the past… (before today) so it chopped off too many</p>
<p dir="auto">and one change in calendarfetcher.js to put out a better diagnostic message of the parsed data… (exdate was excluded cause JSON stringify couldn’t convert the complex structure)</p>
<p dir="auto">I added the tests you all have documented</p>
<p dir="auto">please re-pull and checkout the new branch (I deleted the old branch)<br />
and npm run install-mm again</p>
]]></description><link>https://forum.magicmirror.builders/post/120636</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/120636</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Thu, 17 Oct 2024 16:13:44 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Tue, 24 Sep 2024 10:43:44 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> I found the reason and created a <a href="https://github.com/MagicMirrorOrg/MagicMirror/pull/3555" target="_blank" rel="noopener noreferrer nofollow ugc">pull request</a></p>
]]></description><link>https://forum.magicmirror.builders/post/119999</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119999</guid><dc:creator><![CDATA[MarcLandis]]></dc:creator><pubDate>Tue, 24 Sep 2024 10:43:44 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Tue, 24 Sep 2024 08:14:40 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> I am going to debug this. The ics was slightly modified, when I noticed the bug.</p>
]]></description><link>https://forum.magicmirror.builders/post/119998</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119998</guid><dc:creator><![CDATA[MarcLandis]]></dc:creator><pubDate>Tue, 24 Sep 2024 08:14:40 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Sat, 21 Sep 2024 01:10:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marclandis" aria-label="Profile: MarcLandis">@<bdi>MarcLandis</bdi></a> hm, same calendar entries ?</p>
<p dir="auto">is this on the edited calendar.js or the develop branch?</p>
<p dir="auto">im on a trip til tuesday</p>
]]></description><link>https://forum.magicmirror.builders/post/119929</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119929</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 21 Sep 2024 01:10:55 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Fri, 20 Sep 2024 16:00:27 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> I was on a business trip the last days.</p>
<p dir="auto">I noticed that multi fullday events will be shown one day in the past:</p>
<p dir="auto"><img src="/assets/uploads/files/1726847822907-66765aea-2266-4ddd-9af1-a5d21fa8f36b-image.png" alt="66765aea-2266-4ddd-9af1-a5d21fa8f36b-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">This is from today (20. Sep)</p>
<p dir="auto">I don’t have the config to show past days enables.</p>
]]></description><link>https://forum.magicmirror.builders/post/119927</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119927</guid><dc:creator><![CDATA[MarcLandis]]></dc:creator><pubDate>Fri, 20 Sep 2024 16:00:27 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Tue, 17 Sep 2024 21:19:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marclandis" aria-label="Profile: MarcLandis">@<bdi>MarcLandis</bdi></a>  you could test it now by<br />
<a href="https://forum.magicmirror.builders/topic/14327/testing-new-fixes-or-solving-current">https://forum.magicmirror.builders/topic/14327/testing-new-fixes-or-solving-current</a></p>
<p dir="auto">remember to do (to get release level dependencies)</p>
<pre><code class="language-sh">npm run install-mm
</code></pre>
<p dir="auto">assuming the config in this MM is set correctly for sliceMultiDayEvents</p>
]]></description><link>https://forum.magicmirror.builders/post/119847</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119847</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 17 Sep 2024 21:19:24 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Tue, 17 Sep 2024 10:28:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marclandis" aria-label="Profile: MarcLandis">@<bdi>MarcLandis</bdi></a> the fix was accepted and merged</p>
]]></description><link>https://forum.magicmirror.builders/post/119839</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119839</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 17 Sep 2024 10:28:49 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Tue, 17 Sep 2024 05:34:03 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> Thank you - even it doesn’t make it into the next release I have a way to manually fix it now.</p>
]]></description><link>https://forum.magicmirror.builders/post/119830</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119830</guid><dc:creator><![CDATA[MarcLandis]]></dc:creator><pubDate>Tue, 17 Sep 2024 05:34:03 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Mon, 16 Sep 2024 21:19:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marclandis" aria-label="Profile: MarcLandis">@<bdi>MarcLandis</bdi></a><br />
submitted PR <a href="https://github.com/MagicMirrorOrg/MagicMirror/pull/3543/" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/MagicMirrorOrg/MagicMirror/pull/3543/</a><br />
with new testcase to validate</p>
<p dir="auto">hopefully we will get it into next release Oct 1.</p>
]]></description><link>https://forum.magicmirror.builders/post/119810</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119810</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Mon, 16 Sep 2024 21:19:00 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Mon, 16 Sep 2024 20:20:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marclandis" aria-label="Profile: MarcLandis">@<bdi>MarcLandis</bdi></a> i’ll submit an issue and a pr…</p>
<p dir="auto">and a testcase</p>
]]></description><link>https://forum.magicmirror.builders/post/119809</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119809</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Mon, 16 Sep 2024 20:20:42 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Mon, 16 Sep 2024 20:05:48 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> this fixes it. The test calendar looks good and my real one with the birthdays (mostly affected one) is perfect.  All other events are good too.</p>
<p dir="auto">Thx for your help.</p>
]]></description><link>https://forum.magicmirror.builders/post/119808</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119808</guid><dc:creator><![CDATA[MarcLandis]]></dc:creator><pubDate>Mon, 16 Sep 2024 20:05:48 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Mon, 16 Sep 2024 19:55:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marclandis" aria-label="Profile: MarcLandis">@<bdi>MarcLandis</bdi></a>  interesting…</p>
<p dir="auto">change calendar.js 3 places<br />
give it a try</p>
<p dir="auto">change  (line 633)</p>
<pre><code>const maxCount = Math.ceil((event.endDate - 1 - moment(event.startDate, "x").endOf("day").format("x")) / ONE_DAY) + 1;
</code></pre>
<p dir="auto">to</p>
<pre><code>const maxCount = Math.round((event.endDate - 1 - moment(event.startDate, "x").endOf("day").format("x")) / ONE_DAY) + 1;
</code></pre>
<p dir="auto">ceil takes 1.04 to 2, round to 1</p>
<pre><code>					let midnight
						= moment(event.startDate, "x")
							.clone()
							.startOf("day")
							.add(1, "day")
							.endOf('day')  // add this (else its start of day, not end) line 641
							.format("x");
</code></pre>
<p dir="auto">and recalc of midmnight (line split like above for clarity) line 654</p>
<pre><code>	midnight = moment(midnight, "x")
                                   .add(1, "day")
                                   .endOf('day')  // add this 
                                   .format("x"); // next day

works in Europe/Berlin and America/Chicago 
2 bugs
1 count incorrect
2 loop control</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/119805</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119805</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Mon, 16 Sep 2024 19:55:37 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Mon, 16 Sep 2024 15:49:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marclandis" aria-label="Profile: MarcLandis">@<bdi>MarcLandis</bdi></a> ok. system timezone.</p>
]]></description><link>https://forum.magicmirror.builders/post/119797</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119797</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Mon, 16 Sep 2024 15:49:19 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Mon, 16 Sep 2024 14:46:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marclandis" aria-label="Profile: MarcLandis">@<bdi>MarcLandis</bdi></a> so it doesn’t happen when setting the time zone to America/Chicago but it happens for Europe/Berlin.</p>
]]></description><link>https://forum.magicmirror.builders/post/119795</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119795</guid><dc:creator><![CDATA[MarcLandis]]></dc:creator><pubDate>Mon, 16 Sep 2024 14:46:18 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Mon, 16 Sep 2024 14:30:30 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> I am pretty sure it has to do with timezone settings. I am going to test some things on my end.</p>
<p dir="auto">btw: I have this problem for a long time and more or less always ignored it.</p>
]]></description><link>https://forum.magicmirror.builders/post/119794</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119794</guid><dc:creator><![CDATA[MarcLandis]]></dc:creator><pubDate>Mon, 16 Sep 2024 14:30:30 GMT</pubDate></item><item><title><![CDATA[Reply to calendar - wrong repeating count when using sliceMultiDayEvents on Mon, 16 Sep 2024 14:02:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marclandis" aria-label="Profile: MarcLandis">@<bdi>MarcLandis</bdi></a> said in <a href="/post/119790">calendar - wrong repeating count when using sliceMultiDayEvents</a>:</p>
<blockquote>
<p dir="auto">sliceMultiDayEvents</p>
</blockquote>
<p dir="auto">thanks for the config</p>
<p dir="auto">looking at the results without  sliceMultiDayEvents<br />
I see<br />
<img src="/assets/uploads/files/1726494183952-screenshot-at-2024-09-16-08-39-29.png" alt="Screenshot at 2024-09-16 08-39-29.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">so the parsing was correct,  the visual, we only show the start date, even if multi-day<br />
so both are ‘correct’ tho not informative</p>
<p dir="auto">with split day</p>
<p dir="auto"><img src="/assets/uploads/files/1726494298556-screenshot-at-2024-09-16-08-39-58.png" alt="Screenshot at 2024-09-16 08-39-58.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I don’t see any difference in the calendar parsing. (add “DEBUG” to the loglevel list in config.js)<br />
and redirect the npm start output to a file</p>
<pre><code class="language-text">Calendar-Fetcher: Broadcasting 4 events from http://localhost:8090/modules/default/calendar/splitdays_test.ics. 
</code></pre>
<p dir="auto">only 4 events… so not calendar parsing,<br />
the only place the split  parm is used is in the front end… calendar.js<br />
but my output is different than yours.</p>
<p dir="auto">I am using the develop branch, coming Oct 1.  however I don’t see a documented change here<br />
this split code was added in 2019…<br />
also tested on master (2.28.0) with same 4 lines of results</p>
<p dir="auto">you can get the develop branch and try it…<br />
<a href="https://forum.magicmirror.builders/topic/14327/testing-new-fixes-or-solving-current-problems-with-next-release-code">https://forum.magicmirror.builders/topic/14327/testing-new-fixes-or-solving-current-problems-with-next-release-code</a></p>
<p dir="auto">I just copy/pasted your ics info in a file, unchanged</p>
<p dir="auto">I tested with America/Chicago timezone.</p>
]]></description><link>https://forum.magicmirror.builders/post/119793</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/119793</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Mon, 16 Sep 2024 14:02:56 GMT</pubDate></item></channel></rss>