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

module calendar showing full day events one day to long

Scheduled Pinned Locked Moved Unsolved Troubleshooting
19 Posts 5 Posters 6.7k 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.
  • A Offline
    AnduriI
    last edited by Nov 12, 2018, 1:07 PM

    Hi,

    I use the standard calendar module and it works to my expactations. Only one thing is strange: when I enter a full day event in my google calendar, no matter if 1 day or multiple days, it will be displayed to be on day longer on the MagicMirror.
    So a full day event for today (12th october) would be display for today and tomorrow (12th to 13th october). Does anyone know why?

    Regards,
    Anduril

    ? L 2 Replies Last reply Nov 12, 2018, 1:13 PM Reply Quote 0
    • ? Offline
      A Former User @AnduriI
      last edited by Nov 12, 2018, 1:13 PM

      @andurii
      I’m not sure, but different timezone setting between your mirrors and Google calendar could cause that kind.

      1 Reply Last reply Reply Quote 0
      • A Offline
        AnduriI
        last edited by Nov 12, 2018, 1:52 PM

        I just checked, my google account is set to timezone Berlin and my raspberry is too (set in raspi-config). Is there an additional setting for the magicmirror?

        1 Reply Last reply Reply Quote 0
        • N Offline
          Nilnik Project Sponsor
          last edited by Nov 12, 2018, 2:43 PM

          Hello! Check this link: https://forum.magicmirror.builders/topic/8856/calendar-module-1-day-error/3

          1 Reply Last reply Reply Quote 1
          • S Offline
            StrIIker
            last edited by Nov 12, 2018, 4:55 PM

            Per @Nilnik 's comment, have a look at that thread. I was having the same issue as well (that’s the thread I had started). Ultimately, it came down to adding the showEnd: false, to the config for the calendar.

            timeFormat: 'absolute',
            showEnd: false,
            
            1 Reply Last reply Reply Quote 0
            • A Offline
              AnduriI
              last edited by Nov 15, 2018, 11:52 AM

              thanks for your comments @Nilnik @StrIIker
              This solves the problem, but that’s not a solution :-)
              It’s more a kind of a hack to hide the problem. I use it to show my daily apointments inclunding multiday ones. Having the mirror show only e.g. my holiday started 5 days ago without a duration is kind of useless.
              As I’m not the only one having that, did anyone ever looked into deeply? Where does this start? Is it a problem with timezones incorrectly submitted by google calendar? Is it a problem of fetching in MM?
              If anyone has a guess, I would greatly appreciate any help. When I know where to look, I might also try to search the root of that bug.
              Are there some people using it and where it works correctly? Or is simply no one using this module at all (without that hack)?

              L 1 Reply Last reply Nov 15, 2018, 2:14 PM Reply Quote 0
              • L Offline
                lavolp3 Module Developer @AnduriI
                last edited by Nov 15, 2018, 2:14 PM

                @andurii Without looking close on it, I could imagine it’s a matter of timestamps being interpreted by the moment() function.
                If a full date event creates two timestamps that translate to “Today 0:00:000 - Tomorrow 0:00:000” then it would include tomorrow in the MM translation.
                However, I’m not sure about this. Will check into it as well. Interesting topic.

                And you’re right, showEnd: false is not more than a workaround.

                How to troubleshoot modules
                MMM-soccer v2, MMM-AVStock

                1 Reply Last reply Reply Quote 0
                • L Offline
                  lavolp3 Module Developer
                  last edited by Nov 15, 2018, 2:21 PM

                  Here’s the relevant code:

                  					} else {
                  						/* Check to see if the user displays absolute or relative dates with their events
                  						* Also check to see if an event is happening within an 'urgency' time frameElement
                  						* For example, if the user set an .urgency of 7 days, those events that fall within that
                  						* time frame will be displayed with 'in xxx' time format or moment.fromNow()
                  						*
                  						* Note: this needs to be put in its own function, as the whole thing repeats again verbatim
                  						*/
                  						if (this.config.timeFormat === "absolute") {
                  							if ((this.config.urgency > 1) && (event.startDate - now < (this.config.urgency * oneDay))) {
                  								// This event falls within the config.urgency period that the user has set
                  								timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
                  							} else {
                  								timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.fullDayEventDateFormat));
                  							}
                  						} else {
                  							timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
                  						}
                  					}
                  					if(this.config.showEnd){
                  						timeWrapper.innerHTML += "-" ;
                  						timeWrapper.innerHTML += this.capFirst(moment(event.endDate  , "x").format(this.config.fullDayEventDateFormat));
                  					}
                  
                  

                  You can see in the end, that an end to the date is created if showEnd is true. So as far as I can see it, it all comes down to what

                  event.endDate
                  

                  generates.

                  How to troubleshoot modules
                  MMM-soccer v2, MMM-AVStock

                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    StrIIker
                    last edited by Nov 15, 2018, 2:27 PM

                    @AnduriI I agree that this is a kludge to get the calendar working. I had tried out MMM-MyCalendar which didn’t appear to have this issue (all day events like holidays and birthdays displayed the correct date). It’s a great module BUT, I decided not to use it because I can’t change the colors of the calendars and I could not use a custom icon for different calendars. For example, on my calendar, I have three calendars (US Holidays - white, Birthday calendar - purple with cake icon, and appointments - green). It helps to highlight the different events showing up in the list. I didn’t reach out to the module developer to request this yet. Give it a look, it might be what you are looking for.

                    Unfortunately Magic Mirror has issues which need a kludge hack to resolve (I need to cron a restart of the Magic Mirror application every 5 hours otherwise it goes black (not a screen saver or power saving thing). This has been present for since at least the previous build. Still, I love the Magic Mirror platform and the community is amazing! I am grateful every time I come here and see people helping each other out…

                    L 1 Reply Last reply Nov 15, 2018, 2:33 PM Reply Quote 0
                    • L Offline
                      lavolp3 Module Developer
                      last edited by lavolp3 Nov 15, 2018, 2:47 PM Nov 15, 2018, 2:30 PM

                      Well this MAY be it. calendarfetcher.js

                      					if (typeof event.end !== "undefined") {
                      						endDate = eventDate(event, "end");
                      					} else if(typeof event.duration !== "undefined") {
                      						dur=moment.duration(event.duration);
                      						endDate = startDate.clone().add(dur);
                      
                      

                      if duration is EXACTLY 24h for a full day event, we would land up at the next day with this .add-function
                      You COULD try the following:

                      Go into calendarfetcher.js and change in line 96

                      endDate = startDate.clone().add(dur);
                      

                      to something like

                      endDate = startDate.clone().add(dur-10000);
                      

                      I can’t do it, I’m at work and REALLY need to go back to it now :-)

                      EDIT: …well, I needed to try. That’s not the solution. But it should be somewhere in that file :-)

                      How to troubleshoot modules
                      MMM-soccer v2, MMM-AVStock

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        3/19
                        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