• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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 showing "in X day" wrongly

Scheduled Pinned Locked Moved Troubleshooting
20 Posts 6 Posters 11.8k Views 6 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.
  • C Offline
    creepwood
    last edited by creepwood Nov 8, 2016, 10:24 PM Nov 8, 2016, 10:22 PM

    I started configuring and testing MMM a couple of days ago. I set it up with a couple of calendars, my facebook birthday feed for instance. For some reason it’s showing for example “in one day” when it’s really in two days. It’s shows “Tomorrow” correctly,

    so let’s say today is the 8th. I have one friends birthday on the 9th and one on the 10th. On the one that’s having birthday tomorrow it says tomorrow but on the one having her birthday on the 10th it says “in one day” even though it’s really two days. The exact same thing happend on the 7th when it showed the person having her birthday on the 9th it said “in one day”

    I thought it might’ve been something with the Swedish translation on the mod but I changed to english now and it’s the same issue. Could it be something about the time zone?

    EDIT: I just checked the timezone in raspi-config and it’s the right one CET (GMT+1)

    B 1 Reply Last reply Nov 9, 2016, 3:14 AM Reply Quote 0
    • B Offline
      bhepler Module Developer @creepwood
      last edited by Nov 9, 2016, 3:14 AM

      @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.

      1 Reply Last reply Reply Quote 0
      • K Offline
        KirAsh4 Moderator
        last edited by Nov 9, 2016, 4:35 AM

        @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.

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

        C C 2 Replies Last reply Nov 9, 2016, 5:15 AM Reply Quote 0
        • C Offline
          Cato Module Developer @KirAsh4
          last edited by Cato Nov 9, 2016, 5:16 AM Nov 9, 2016, 5:15 AM

          @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?

          1 Reply Last reply Reply Quote 1
          • C Offline
            creepwood @KirAsh4
            last edited by Nov 9, 2016, 4:12 PM

            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.

            1 Reply Last reply Reply Quote 0
            • K Offline
              KirAsh4 Moderator
              last edited by Nov 13, 2016, 6:25 AM

              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.

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

              C 1 Reply Last reply Nov 14, 2016, 5:31 PM Reply Quote 1
              • C Offline
                creepwood @KirAsh4
                last edited by Nov 14, 2016, 5:31 PM

                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.

                B T 2 Replies Last reply Nov 14, 2016, 8:16 PM Reply Quote 0
                • B Offline
                  bhepler Module Developer @creepwood
                  last edited by Nov 14, 2016, 8:16 PM

                  @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.

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    tajno @creepwood
                    last edited by Nov 14, 2016, 8:35 PM

                    @creepwood

                    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.

                    C 1 Reply Last reply Nov 14, 2016, 8:40 PM Reply Quote 2
                    • C Offline
                      creepwood @tajno
                      last edited by creepwood Nov 14, 2016, 8:40 PM Nov 14, 2016, 8:40 PM

                      @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.

                      T 1 Reply Last reply Nov 14, 2016, 9:04 PM Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        6/20
                        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