Navigation

    MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.15.0 is available! For more information about this release, check out this topic.

    Calendar Module : in x days give bad value

    Troubleshooting
    2
    2
    1282
    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
      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
      • KirAsh4
        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.

        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 Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy