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

Scheduled Pinned Locked Moved Troubleshooting
3 Posts 2 Posters 3.8k Views 2 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
    clumsy_ninja
    last edited by Oct 29, 2016, 8:00 AM

    Hi,

    I’ve configured the default calendar to use my google ical but i wanted to use the maximumNumberOfDays option to limit it to show two weeks (14 days).

    After restarting the app it showed no difference though. has anyone else had this option working or not working? or anything special that needs to be done?

    Thanks in advance!

    B 1 Reply Last reply Oct 30, 2016, 3:18 AM Reply Quote 0
    • B Offline
      bhepler Module Developer @clumsy_ninja
      last edited by Oct 30, 2016, 3:18 AM

      @clumsy_ninja First, I just want to say you sent me down a really interesting rabbit hole.

      At first, I couldn’t get it to work. My development environment has the mirror mounted on the wall and I SSH into the Pi. I run a browser tab in Chrome with the developer options on so I can see the logs. This was surprisingly frustrating as I could not get the maximumNumberOfDays parameter to work. After much thrashing about, I discovered that the only way to get that parameter to work was to restart the mirror process, not just reload the browser page.

      So this configuration in my config.js works:

      {
      	module: 'calendar',
      	header: 'US Holidays',
      	position: 'top_left',
      	config: {
      		maximumNumberOfDays:120,
      		calendars: [
      			{
      			symbol: 'calendar-check-o ',
      			url: 'webcal://www.calendarlabs.com/templates/ical/US-Holidays.ics',
      			},
      			{
      			symbol: 'imdb',
      			url: 'https://www.google.com/calendar/ical/pfutdblf1gi8jmfsvroh76f6jg%40group.calendar.google.com/public/basic.ics',
      			}
      		],
      	}
      },
      

      Which is all well and good, but the maximumNumberOfDays would not take effect until I restarted the mirror process: pm2 restart 0. After that, the mirror would show the correct events and refreshing the browser would also show the correct number of events. I’m guessing that the calendar module is creating a calendarfetcher at the beginning of the MagicMirror process and any changes to the config file will only take effect whenever the calendar interval hits (or when you restart the Mirror process). If you make your change and wait for the calendar module to refresh your calendar, your changes to the maximumNumberOfDays should take effect then.

      1 Reply Last reply Reply Quote 1
      • C Offline
        clumsy_ninja
        last edited by Oct 30, 2016, 9:44 AM

        @bhepler Thanks for you reply, I’m glad you got it to work in the end :)

        I was in the middle of writing a big response and had my config file pasted in and everything and then…
        I realised i had it set in a layer to high, in the module config rather than the calendar config (facepalm) :(

        anyhow, its working now so Yay!! haha

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