Read the statement by Michael Teeuw here.
Calendar showing "in X day" wrongly
-
@creepwood It’s possible that the script library counts in a more literal fashion than people do. In your example, your friend’s birthday on the 10th is “in two days” as people describe it. But it’s technically less than 48 hours. That might make the calculations get weird.
[shrug] It’s a theory.
-
@bhepler is correct here. It calculates based on midnight. It’s in “one day” starting at “the next closest midnight”. That’s simply the way moment.js calculates time.
-
@KirAsh4 I agree with OP that this is an unnatural way of counting days for humans.
Wouldn’t it be possible to do different calculations based on if it’s more or less that 24 hours?
-
So crassly speaking, the module isn’t really working correctly.
There are different ways to calculate it with the right result, it just depends on how you want to do it. I’m just surprised that it isn’t already working like that, I can’t be the only one finding this an issue.
-
Guys, please read what I said above: it’s the way Moment.js calculates time. The actual module does not do any kind of time calculations, it simply passes the information to and from Moment.js.
If you want the calculations to be done different, then please write a new module, using a different library, and submit a PR request. All of MagicMirror uses the Moment.js library, for any kind of time calculations.
-
If you want the calculations to be done different,
I’m adamant that however you turn and twist this argument. it’s not “different” it’s incorrect. “tomorrow” and “in 1 day” means the same thing. If MMM says it isn’t, MMM is wrong.
-
@creepwood If you’re not happy with the way the module calculates the dates, you’re welcome to write your own.
See, this way it’s not an argument. It’s a suggestion.
-
I’m not a dev, but a workmate shows me the followed video about development and timezone(s), since then - I never mess with a dev about this thing again - Maybe it helps you to understand that those thins “aren’t just easy” as we think from our point of view :).
https://www.youtube.com/watch?v=-5wpm-gesOY
Have fun, its a nice insight.
-
@tajno I don’t develop professionally any more but I’m aware of the issue with timezones but this should not be a big deal and from what I understand the MMM dev is Netherlander which is the same timezone as I’m in.
I’m baffled that nobody else seem to think this is an issue when it says in x day when it actually seem to mean x + 1 day.
-
It’s not that, I don’t have this problem - Never seen a “in 1 day”. Maybe its a wrong value provided by your calendar? Do you have multiple calendars - and it appears at everyone?
I use now 8 different Calendars and I don’t get that issue - So I can’t say anything about it.