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

Default Calendar // Multiple caldendar instances overwritting each other..(maximumNumberOfDays)

Scheduled Pinned Locked Moved Unsolved Troubleshooting
7 Posts 3 Posters 2.4k Views 5 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.
  • B Offline
    bolish
    last edited by Jan 22, 2019, 7:46 PM

    Hi there,

    I don’t exactly what I’m doing wrong or if the issue comes from the module itself.

    My issue :

    I’m running 3 instances of the default calendar.
    In some case, the 3 calendars instances are pointing to the same calendars URL, nevertheless, I want the 3 instances to have a different “maximumNumberOfDays” config.

    The “maximumNumberOfDays” of instance 1 is overwritten by the 2 second instance settings, and so on…Making my wish to have different setups impossible as all the 3 instances are using same “maximumNumberOfDays”.

    You will find my code hereunder, help would be highly appreciated!!

    		{
    			disabled: false,
    			module: "calendar",
    			header: "Aujourd'hui",
    			position: "top_left",
    			config: {
    				timeFormat: "absolute",
    				maximumNumberOfDays: 1,
    				excludedEvents: [],
    				calendars: [
    					{       
    						// Anniversaires
    						symbol: "birthday-cake",
    						url: "https://1.ics",
    						maximumNumberOfDays: 1
    					},
    					{
    						// Calendrier Fabrice
    						symbol: "calendar-check",
    						url: "https://2.ics",
    						maximumNumberOfDays: 1
    					},
    					{
    						// Calendrier Audrey
    						symbol: "calendar-check-o",
    						url: "https://3.ics",
    						maximumNumberOfDays: 1
    					},
    					{
    						// Calendrier Férié
    						symbol: "flag",
    						url: "https://4.ics",
    						maximumNumberOfDays: 1
    					},
    					{
    						// Vacances Scolaires
    						symbol: "sun",
    						url: "http://www.5.ics",
    						maximumNumberOfDays: 1
    					},
    					{
    						// Repas
    						symbol: "utensils",
    						url: "https://6.ics",
    						maximumNumberOfDays: 1
    					}
    				],
    			}
    		},
    		{
    			disabled: true,
    			module: "calendar",
    			header: "Demain",
    			position: "top_left",
    			config: {
    				timeFormat: "absolute",
    				maximumNumberOfDays: 2,
    				excludedEvents: [],
    				calendars: [
    					{
    						// Anniversaires
    						symbol: "birthday-cake",
    						url: "https://1.ics",
    						maximumNumberOfDays: 2
    					},
    					{
    						// Calendrier Fabrice
    						symbol: "calendar-check",
    						url: "https://2",
    						maximumNumberOfDays: 2
    					},
    					{
    						// Calendrier Audrey
    						symbol: "calendar-check-o",
    						url: "https://3.ics",
    						maximumNumberOfDays: 2
    					},
    					{
    						// Calendrier Férié
    						symbol: "flag",
    						url: "https://4.ics",
    						maximumNumberOfDays: 2
    					},
    					{
    						// Vacances Scolaires
    						symbol: "sun",
    						url: "http://5.ics",
    						maximumNumberOfDays: 2
    					},
    					{
    						// Repas
    						symbol: "utensils",
    						url: "https://6.ics",
    						maximumNumberOfDays: 2	
    					}
    				],
    			}
    		},
    		{
    			disabled: false,
    			module: "calendar",
    			header: "Evénements à venir",
    			position: "top_left",
    			config: {
    				timeFormat: "absolute",
    				maximumNumberOfDays: 62,
    				excludedEvents: ["Poney"],
    				calendars: [
    					{
    						// Anniversaires
    						symbol: "birthday-cake",
    						url: "https://1.ics",
    						//maximumNumberOfDays: 62
    					},
    					{
    						// Calendrier Fabrice
    						symbol: "calendar-check",
    						url: "https://2.ics",
    						//maximumNumberOfDays: 62
    					},
    					{
    						// Calendrier Audrey
    						symbol: "calendar-check-o",
    						url: "https://3.ics",
    						//maximumNumberOfDays: 62
    					},
    					{
    						// Calendrier Férié
    						symbol: "flag",
    						url: "https://4.ics",
    						//maximumNumberOfDays: 62
    					},
    					{
    						// Vacances Scolaires
    						symbol: "sun",
    						url: "http://5.ics",
    						//maximumNumberOfDays: 62
    					}
    				],
    			}
    		},
    

    NOTE : it seems that the issue was already pointed out on Github, and MichMich even stating that this could be easy to solve, but I clearly have no clue how…
    GitHub Issue #1109

    Anyway, really hope someone could support my need…

    Thanks in advance

    1 Reply Last reply Reply Quote 0
    • B Offline
      bolish
      last edited by Feb 3, 2019, 1:48 PM

      well… I believe it’s far from being perfect…but at least it seems to do the job…

      I created a “new” module which does exactly same / has the same code as the one I want to use, but has a different name (folder named “MMM-Calendar2” -> file named “MMM-Calendar2.js” -> within the line Module.register(‘MMM_Calendar2’)).
      Not in the default module folder but into the 3rd party module folder…

      S 1 Reply Last reply Feb 3, 2019, 1:50 PM Reply Quote 0
      • S Offline
        sdetweil @bolish
        last edited by Feb 3, 2019, 1:50 PM

        @bolish did u change something from the original?

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • B Offline
          bolish
          last edited by Feb 3, 2019, 1:50 PM

          no… just copy paste, renaming.

          S 1 Reply Last reply Feb 3, 2019, 1:51 PM Reply Quote 0
          • S Offline
            sdetweil @bolish
            last edited by Feb 3, 2019, 1:51 PM

            @bolish so, are you running BOTH calender modules, default and your ‘new’ one?

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • B Offline
              bolish
              last edited by Feb 3, 2019, 1:53 PM

              yes indeed.

              1 Reply Last reply Reply Quote 0
              • H Offline
                hiesscher
                last edited by Oct 11, 2020, 11:48 AM

                Some additional Information:

                In calendarfetcher.js and nodehelper.js is the following line:

                const Log = require("../../../js/logger.js");
                

                If you copy the “calendar” folder down to “modules” this reference will be broken.
                So you have to change to:

                const Log = require("../../js/logger.js");
                
                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 Sam, technical setup by Karsten.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy