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

MMM-CaelendarExt3 Event Format CSS

Scheduled Pinned Locked Moved Custom CSS
8 Posts 3 Posters 1.1k Views 3 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.
  • M Offline
    MMRIZE @kshamus
    last edited by Dec 31, 2023, 3:01 PM

    @kshamus evetTransformer should be placed in config, not css.

    K 1 Reply Last reply Dec 31, 2023, 8:47 PM Reply Quote 0
    • K Offline
      kshamus @MMRIZE
      last edited by Dec 31, 2023, 8:47 PM

      @MMRIZE thanks! that certainly makes more sense.

      My config looks like this with the transform included

      		{
      			  module: "MMM-CalendarExt3",
      			  position: "top_left",
      			  positionOrder: 0,
      		          timeFormat:"h:mm A",
      			  title: "Shamus Family Calendar",
      			  config: {
      			    mode: "week",
      			    instanceId: "basicCalendar",
      			    maxEventLines: 10,
      			weekIndex: 0,
      			weeksInView: 4,
      			useSymbol: false,
      			useWeather: false,
      			refreshInterval: 300000,
      			 	firstDayOfWeek: 0,
      			transform: (event) => {
      				if (event.title.search("Max") > -1) {
       				   event.className = "max"
      				   event.title=event.title.replace("Max -","");
      			      } else if (event.title.search("Allison") > -1) {
      				   event.className = "allison"
      				   event.title=event.title.replace("Allison -","");
      				} else if (event.title.search("Gryffin") > -1) {
      				   event.className = "gryffin"
      				  event.title=event.title.replace("Gryffin -","");
      				} else if (event.title.search("Ken") > -1) {
      			   	  event.className = "ken"
      				  event.title=event.title.replace("Ken -","");
      				} else if (event.title.search("Dianna") > -1) {
      			   	  event.className = "dianna"
      				  event.title=event.title.replace("Dianna -","");
      				} else if (event.title.search("bday") > -1) {
      				  event.className = "birthday";						
      				} else if (event.title.search("*Birthday*") > -1) {
      				  event.className = "*birthday*";				
      						}
      						 return event
            					  },				   	
      },
      },
      

      Do I just then modify custom CSS for each class name? Is there a special order of operations? Do I need to add .event?

      .CX2 .max {
         background-color:#8DE7DD;
         color: #000000;
      }
      
      M 1 Reply Last reply Dec 31, 2023, 10:52 PM Reply Quote 0
      • M Offline
        MMRIZE @kshamus
        last edited by Dec 31, 2023, 10:52 PM

        @kshamus
        If you want, you can,. But for the default color, you can assign it on default calendar config.

        S 1 Reply Last reply Dec 31, 2023, 11:38 PM Reply Quote 0
        • S Offline
          sdetweil @MMRIZE
          last edited by Dec 31, 2023, 11:38 PM

          @MMRIZE but he wants color by event,(kids Mom, Dad) not cal

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          K 1 Reply Last reply Jan 1, 2024, 7:12 PM Reply Quote 0
          • K Offline
            kshamus @sdetweil
            last edited by Jan 1, 2024, 7:12 PM

            @sdetweil exactly.

            My thoughts are that either the config “transform event” is not working properly to assign classnames or the CSS setting is being overwritten by a default or higher level setting than the class name. I’m not really sure though

            Note in my code above I have .CX2 but in the CSS, I’ve changed that to .CX3

            S M 2 Replies Last reply Jan 1, 2024, 7:14 PM Reply Quote 0
            • S Offline
              sdetweil @kshamus
              last edited by sdetweil Jan 1, 2024, 7:14 PM Jan 1, 2024, 7:14 PM

              @kshamus you could use the developers window, elements tab to look at the styles applied to elements
              see
              https://forum.magicmirror.builders/post/90135

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • M Offline
                MMRIZE @kshamus
                last edited by Jan 2, 2024, 8:46 AM

                @kshamus
                Use event.class, not event.className.
                5ef76f61-d817-4ae0-9cac-83957e50b515-image.png

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                1 / 1
                • First post
                  6/8
                  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