<?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[Changing moment.js behavior]]></title><description><![CDATA[<p dir="auto">I guess this question would be directed at <a class="plugin-mentions-user plugin-mentions-a" href="/user/michmich" aria-label="Profile: MichMich">@<bdi>MichMich</bdi></a>, but anyone who can help me with this, your ideas would be much appreciated.</p>
<p dir="auto">The calendar currently shows “tomorrow” for events that are scheduled to occur tomorrow. Events that are scheduled to occur a day after tomorrow are shown as “in a day”. Now “tomorrow” and “in a day” are pretty much the same thing in German, so I wanted to include “the day after tomorrow” and was <a href="https://github.com/moment/moment/issues/756" target="_blank" rel="noopener noreferrer nofollow ugc">pointed in a good direction by the moment.js people</a>.</p>
<p dir="auto">However, I’m not able to change the ‘de’ locale file so that it reflects that on my mirror, it just keeps showing the default day definitions, no matter what I do. And I was wondering where I could make the ‘diff &lt; 3’ adjustment for the day after tomorrow so I could include a new moment definition?</p>
]]></description><link>https://forum.magicmirror.builders/topic/563/changing-moment-js-behavior</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 16:07:14 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/563.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 30 Aug 2016 18:57:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Changing moment.js behavior on Mon, 02 Apr 2018 13:12:49 GMT]]></title><description><![CDATA[<p dir="auto">How do you actually use moment.js<br />
my clock is off and i dont know how to change it.<br />
then i got moment.js and still dont know</p>
]]></description><link>https://forum.magicmirror.builders/post/37828</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/37828</guid><dc:creator><![CDATA[chrisgodyn]]></dc:creator><pubDate>Mon, 02 Apr 2018 13:12:49 GMT</pubDate></item><item><title><![CDATA[Reply to Changing moment.js behavior on Thu, 10 Aug 2017 12:42:54 GMT]]></title><description><![CDATA[<p dir="auto">The manipulations with dates can be a time-consuming problem in some cases. Moment.js is a powerful JavaScript library intended to handle with dates and time without any other dependencies.<br />
Briefly, this library allows working conveniently with parsing, validating as well as displaying dates. Besides, it efficiently handles with a necessity to provide your users around the globe with localized time and the right format depending on their location. Moment.js library supports time zone and internalization.<br />
You should use it in case you need to implement some features related to dates and time. Look at more JS libraries in the <em>Cleveroad blog</em></p>
]]></description><link>https://forum.magicmirror.builders/post/26397</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/26397</guid><dc:creator><![CDATA[alina12]]></dc:creator><pubDate>Thu, 10 Aug 2017 12:42:54 GMT</pubDate></item><item><title><![CDATA[Reply to Changing moment.js behavior on Thu, 01 Sep 2016 07:48:15 GMT]]></title><description><![CDATA[<p dir="auto">The PR was just merged into the develop branch. I’ve added a translation for Dutch as well.</p>
]]></description><link>https://forum.magicmirror.builders/post/4258</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/4258</guid><dc:creator><![CDATA[MichMich]]></dc:creator><pubDate>Thu, 01 Sep 2016 07:48:15 GMT</pubDate></item><item><title><![CDATA[Reply to Changing moment.js behavior on Wed, 31 Aug 2016 12:19:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/michmich" aria-label="Profile: MichMich">@<bdi>MichMich</bdi></a> Well, I sort of assumed that a change that somehow breaks the calendar for any other language than German would probably not be merged into the develop branch ^^. But I can have it depend on an if-condition and we can take a look at whether it makes sense to include it in the calendar, will submit a pull request and we’ll take it from there.</p>
]]></description><link>https://forum.magicmirror.builders/post/4177</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/4177</guid><dc:creator><![CDATA[yo-less]]></dc:creator><pubDate>Wed, 31 Aug 2016 12:19:35 GMT</pubDate></item><item><title><![CDATA[Reply to Changing moment.js behavior on Wed, 31 Aug 2016 09:34:54 GMT]]></title><description><![CDATA[<p dir="auto">Feel free to send a pull request so anyone can benefit from this. :)</p>
]]></description><link>https://forum.magicmirror.builders/post/4173</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/4173</guid><dc:creator><![CDATA[MichMich]]></dc:creator><pubDate>Wed, 31 Aug 2016 09:34:54 GMT</pubDate></item><item><title><![CDATA[Reply to Changing moment.js behavior on Tue, 30 Aug 2016 21:39:35 GMT]]></title><description><![CDATA[<p dir="auto">As the calender.js file takes over the days “TODAY” and “TOMORROW” it was actually quite easy to add another definition to take over the “DAYAFTERTOMORROW”.</p>
<p dir="auto">I’ve changed the ‘calender.js’ code to look like this:</p>
<pre><code>...
if (event.fullDayEvent) {
	if (event.today) {
		timeWrapper.innerHTML = this.translate("TODAY");
	} else if (event.startDate - now &lt; one_day &amp;&amp; event.startDate - now &gt; 0) {
		timeWrapper.innerHTML = this.translate("TOMORROW");
	} else if (event.startDate - now &lt; 2*one_day &amp;&amp; event.startDate - now &gt; 0) {
		timeWrapper.innerHTML = this.translate("DAYAFTERTOMORROW");
	} else {
...
</code></pre>
<p dir="auto">And I’ve adjusted /MagicMirror/translations/de.json to look like this</p>
<pre><code>...
	"TOMORROW": "Morgen",
	"DAYAFTERTOMORROW": "Übermorgen",
	"RUNNING": "noch",
...
</code></pre>
<p dir="auto">Which led to this:<br />
<img src="/uploads/files/1472593101467-termine.png" alt="0_1472593100725_termine.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Great, just what I needed… :)</p>
<p dir="auto">I’m aware that this will be overwritten by any update I might perform, but I can’t think of any other way to implement this feature.</p>
]]></description><link>https://forum.magicmirror.builders/post/4159</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/4159</guid><dc:creator><![CDATA[yo-less]]></dc:creator><pubDate>Tue, 30 Aug 2016 21:39:35 GMT</pubDate></item><item><title><![CDATA[Reply to Changing moment.js behavior on Tue, 30 Aug 2016 21:24:08 GMT]]></title><description><![CDATA[<p dir="auto">I’ve just realized that both “today” and “tomorrow” are taken over by the MagicMirror translation engine, this would explain why no change to moments.js locale files made any difference :).</p>
<p dir="auto">So if anyone is ever thinking about adjusting the calendar phrase for “today” or “tomorrow”, take a look at your MagicMirror/translations/ folder.</p>
]]></description><link>https://forum.magicmirror.builders/post/4158</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/4158</guid><dc:creator><![CDATA[yo-less]]></dc:creator><pubDate>Tue, 30 Aug 2016 21:24:08 GMT</pubDate></item><item><title><![CDATA[Reply to Changing moment.js behavior on Tue, 30 Aug 2016 19:50:24 GMT]]></title><description><![CDATA[<p dir="auto">If I can figure out a way to change it locally in my MagicMirror, it’s easier for me to suggest changes to the moment.js crew, however as of now, I can’t change anything, no matter what I do, my calendar keeps reporting the same old information, especially for “tomorrow”. I have figured out a way to change some of the information, such as “in two days” to something like “inn two days” just to see where adjustments have to be made, but no matter what I do, it always says “morgen” for “tomorrow”.</p>
<p dir="auto">I was actually trying to change what the folks at moment.js suggested, but it seemed like my modifications had no impact whatsoever :)</p>
]]></description><link>https://forum.magicmirror.builders/post/4156</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/4156</guid><dc:creator><![CDATA[yo-less]]></dc:creator><pubDate>Tue, 30 Aug 2016 19:50:24 GMT</pubDate></item><item><title><![CDATA[Reply to Changing moment.js behavior on Tue, 30 Aug 2016 19:18:39 GMT]]></title><description><![CDATA[<p dir="auto">You’d have to talk to the moment.js folks (or figure out how to calculate the time difference yourself and pass it on to moment.js to parse for you). If you manually change the moment locales, it will get overwritten at the next update.</p>
]]></description><link>https://forum.magicmirror.builders/post/4154</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/4154</guid><dc:creator><![CDATA[KirAsh4]]></dc:creator><pubDate>Tue, 30 Aug 2016 19:18:39 GMT</pubDate></item><item><title><![CDATA[Reply to Changing moment.js behavior on Tue, 30 Aug 2016 19:09:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kirash4" aria-label="Profile: KirAsh4">@<bdi>KirAsh4</bdi></a> Thanks for the helpful clarification. Wouldn’t it be easy to change that behavior so that it would start calculating based on the current point of time?</p>
<p dir="auto">Regardless of that, I would still like to change the “in a day” notice to “the day after tomorrow”, do you know how I could accomplish that? It seems that /vendor/moment/moment-with-locales.js has  role to play there.</p>
]]></description><link>https://forum.magicmirror.builders/post/4153</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/4153</guid><dc:creator><![CDATA[yo-less]]></dc:creator><pubDate>Tue, 30 Aug 2016 19:09:19 GMT</pubDate></item><item><title><![CDATA[Reply to Changing moment.js behavior on Tue, 30 Aug 2016 19:01:53 GMT]]></title><description><![CDATA[<p dir="auto">That’s strictly a moment.js thing … However, what we humans perceive as ‘in a day’ and ‘tomorrow’ aren’t actually the same thing.</p>
<p dir="auto">moment.js calculates based on midnight. So, an event that happens before midnight <em>tomorrow</em> is considered to be tomorrow. An event that happens after midnight <em>tomorrow</em>, is considered ‘in a day’ because it counts starting AT midnight, and not from the current time. So current time TO midnight, plus 1 day = ‘in a day’. It’s not how we calculate time intuitively, but it’s how computers calculate time, and thus moment.js does that.</p>
]]></description><link>https://forum.magicmirror.builders/post/4152</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/4152</guid><dc:creator><![CDATA[KirAsh4]]></dc:creator><pubDate>Tue, 30 Aug 2016 19:01:53 GMT</pubDate></item></channel></rss>