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

      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

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

          @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

            no… just copy paste, renaming.

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

              @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

                yes indeed.

                1 Reply Last reply Reply Quote 0
                • H Offline
                  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

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  • 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