MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.24.0 is available! For more information about this release, check out this topic.

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

    Troubleshooting
    3
    7
    1368
    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
      bolish last edited by

      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
        bolish last edited by

        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 Reply Quote 0
        • S
          sdetweil @bolish last edited by

          @bolish did u change something from the original?

          Sam

          Create a working config
          How to add modules

          1 Reply Last reply Reply Quote 0
          • B
            bolish last edited by

            no… just copy paste, renaming.

            S 1 Reply Last reply Reply Quote 0
            • S
              sdetweil @bolish last edited by

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

              Sam

              Create a working config
              How to add modules

              1 Reply Last reply Reply Quote 0
              • B
                bolish last edited by

                yes indeed.

                1 Reply Last reply Reply Quote 0
                • H
                  hiesscher last edited by

                  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 Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                  This forum is using NodeBB as its core | Contributors
                  Contact | Privacy Policy