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.

    Issue Calendar CustomEvents color

    Scheduled Pinned Locked Moved Solved Troubleshooting
    6 Posts 2 Posters 1.5k 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.
    • S Offline
      sdetweil @mboss
      last edited by

      @mboss looks right

      the code

      			// Color events if custom color is specified
      			if (this.config.customEvents.length > 0) {
      				for (let ev in this.config.customEvents) {
      					if (typeof this.config.customEvents[ev].color !== "undefined" && this.config.customEvents[ev].color !== "") {
      						let needle = new RegExp(this.config.customEvents[ev].keyword, "gi");
      						if (needle.test(event.title)) {   <000000  this is the test, EXACT match (case insensitive.. spaces matter)
      							// Respect parameter ColoredSymbolOnly also for custom events
      							if (!this.config.coloredSymbolOnly) {
      								eventWrapper.style.cssText = "color:" + this.config.customEvents[ev].color;
      								titleWrapper.style.cssText = "color:" + this.config.customEvents[ev].color;
      							}
      							if (this.config.displaySymbol) {
      								symbolWrapper.style.cssText = "color:" + this.config.customEvents[ev].color;
      							}
      							break;
      						}
      					}
      				}
      			}
      

      so… I would download the ICS file

      curl -sL the_cal_url >xxx.ics

      then edit xxx.ics (just a text file, don’t OPEN it with file explorer right click open with … some text editor) and search for your keywords, exactly

      last time, some had TWO spaces between the words

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      M 1 Reply Last reply Reply Quote 0
      • M Offline
        mboss @sdetweil
        last edited by

        @sdetweil Thanks for the response,

        so I have downloaded the .ics file and had a look though. I cut and pasted the event descriptions into my MM config file, unfortunately still no colour action.

        I have even tried using just one keyword to match “Black, Blue, Green” as those would be the identifiers for each event, again still nothing.

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

          @mboss i just took your custom events structure and
          change the keyword to something in one of my events and color
          and it worked 1st try…

          the thing you are looking for is in the SUMMARY field, NOT the description field, right?

          SUMMARY:power windows  testing
          

          and the def

          					customEvents: [
          					{
          						/*Black Bin (your comment)*/
          						keyword: 'windows',
          						color: 'red'
          					},
                                                 ]
          

          and I rechecked with multiple words separated by one space, good…
          and more than 1 space, but keyword has 1 space, not changed… (as expected)

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          M 1 Reply Last reply Reply Quote 0
          • M Offline
            mboss @sdetweil
            last edited by mboss

            @sdetweil

            Apologies for the late follow-up things got busy around the house.

            So I went back to basics to debug what I was doing wrong… I added just the bin pick-up calendar and the custom events code to a clean config file. Worked right away, just when I went to use the module “MMM-monthlyCalendar” that would not show the custom events colour.

            Thank you for helping me, guess I’m on to looking for a new calendar module.

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

              @mboss each module does its own thing…

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              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