Read the statement by Michael Teeuw here.
Calendar Module : in x days give bad value
-
Hi!
first, what a nice project this MagicMirror.I’m using the calendar module with two ical : facebook et garmin
On display, the module gives the right informations about event for today or tomorrowBut for an event in 2 days or more, it seem calculate a wrong value…
For exemple (same problem with facebook and garmin calendar) :
today is august 10.
Birthday A : august 10 - shows today
Birthday B : august 11 - shows tomorrow
Birthday C : august 12 - shows in 1 day? Show display “in 2 days”
Birthday D : august 14 - shows in 3 days? Show display “in 4 days”thanks
Sébastien -
The calculations are correct for how a computer calculates it:
Birthday A : august 10 - shows today Birthday B : august 11 - shows tomorrow Birthday C : august 12 - shows in 1 day? Show display "in 2 days" Birthday D : august 14 - shows in 3 days? Show display “in 4 days”Calculations are done starting at the next midnight. So:
Birthday A : august 10 - shows today -- at the next midnight, it's day 0 Birthday B : august 11 - shows tomorrow -- at midnight, it will be day 0 + 1, so 'in 1 day' or 'tomorrow' Birthday C : august 12 - shows in 1 day? Show display "in 2 days" -- at midnight, it will be day 0 + 2, so 'in 2 days' Birthday D : august 14 - shows in 3 days? Show display “in 4 days” -- at midnight, it will be day 0 + 4, so 'in 4 days'The way the calculations are done isn’t perfect, but it’s how Moment.js returns those values, based on midnight.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login