Calendar - maximumNumberOfDays



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



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



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


Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.