MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Calendar Module : in x days give bad value

    Scheduled Pinned Locked Moved Troubleshooting
    2 Posts 2 Posters 2.4k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      scarri
      last edited by

      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 tomorrow

      But 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

      1 Reply Last reply Reply Quote 0
      • KirAsh4K Offline
        KirAsh4 Moderator
        last edited by

        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.

        A Life? Cool! Where can I download one of those from?

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Enjoying MagicMirror? Please consider a donation!
        MagicMirror created by Michael Teeuw.
        Forum managed by Sam, technical setup by Karsten.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy