• 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-CalendarExt3 color formatting

Scheduled Pinned Locked Moved Solved Troubleshooting
15 Posts 6 Posters 3.9k Views 7 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.
  • J Offline
    jlward73
    last edited by Jan 26, 2024, 6:51 AM

    I’m new to Magic Mirror, but am running into an issue getting MMM-CalendarExt3 to format colors properly. I have been able to pass multiple calendars and the events are displaying the correct information, but the color formatting for each calendar is not working, they are all just showing white text or white background with black text. I know some color is working as the weekends were showing up red and “dodgerblue” before I commented those out (Go Padres!). I’m running module version 1.8.0 and have the following calendar snippet in my config.js file:

    {
    module: 'calendar',
    header: 'Upcoming Events',
    position: 'top_left',
    config: {
         coloredText: true,
         coloredSymbol: true,
         customEvents: [{keyword: "Birthday", symbol: "birthday-cake", color: "#FFFF00"}],
         calendars: [
              {
              fetchInterval: 1000*60*60*24*7, //Holiday Calendar
              name: "holidays",
              color: "#385723", 
              symbol: 'umbrella-beach',
              broadcastPastEvents: true, 
              url: 'https://calendar.google.com/calendar/.../basic.ics',
              },
              {
              fetchInterval: 1000*60*5,  //Family Calendar
              name: "Family",
              color: "#7030A0",
              symbol: 'calendar-check',
              broadcastPastEvents: true, 
              url: "https://calendar.google.com/.../basic.ics",
              },
         ]
    } //close config
    }, //close module
    

    The keyword for birthdays is working within the default calendar, but that does not transfer over to the CalendarExt3 Module.
    Additionally, in looking at the .css file, I see the following snippet:

    .CX3 .event.fullday,
    .CX3 .event.multiday {
      background-color: var(--calendarColor);
      mix-blend-mode: difference;
      border-radius: 4px;
      color: var(--oppositeColor);
    }
    
    
    .CX3 .event.singleday .headline:not(.useSymbol)::before,
    .CX3 .event.singleday .headline.useSymbol .symbol.noSymbol::before {
      content: "⬤";
      color: var(--calendarColor);
      display: inline-block;
      padding-right: 2px;
      font-size: 75%;
    }
    

    It appears the CalendarExt3 module should be pulling the color from the basic calendar module in the config file, but I’m not seeing it.
    I do see in the .CX3 .event {} block above this that uses color:--defaultcolor. Is this overriding something? Any guidance would be appreciated.

    M 1 Reply Last reply Jan 26, 2024, 3:54 PM Reply Quote 0
    • M Offline
      MMRIZE @jlward73
      last edited by MMRIZE Jan 26, 2024, 3:58 PM Jan 26, 2024, 3:54 PM

      @jlward73
      Unfortunately, default calendar module doesn’t broadcast custom color of events, only transfer original color assigned in calendar. Shamed.
      Instead you can transform events in CX3 itself.

      J 1 Reply Last reply Jan 26, 2024, 11:12 PM Reply Quote 0
      • J Offline
        jlward73 @MMRIZE
        last edited by Jan 26, 2024, 11:12 PM

        @MMRIZE I’m not concerned about the keyword transformation custom color going through. What I am really trying to figure out is why the original colors that I assign (#385723 for ‘holidays’, and #7030A0 for ‘Family’) are not showing up on the CalendarExt3 Module. The symbols are passing properly, even the keyword transform for “birthday-cake”, but none of the colors are passing.

        S M 2 Replies Last reply Jan 26, 2024, 11:37 PM Reply Quote 0
        • S Offline
          sdetweil @jlward73
          last edited by sdetweil Jan 26, 2024, 11:38 PM Jan 26, 2024, 11:37 PM

          @jlward73 as the data is broadcast to all modules, you could install one of the notification modules and look at the event data to see what is there

          also try “red” or “green” as the color, altho that shouldn’t matter

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          J 1 Reply Last reply Jan 28, 2024, 6:05 PM Reply Quote 0
          • M Offline
            MMRIZE @jlward73
            last edited by Jan 27, 2024, 1:07 AM

            @jlward73
            About the style of event;

            8c0b2af8-7a7d-4f88-9092-1dff9e791054-image.png

            The default styles are like these;

            • Singleday Event (start and end in one day)
              • symbol : calendarColor
              • text : white (defaultColor)
              • background : none
            • Fullday Event & Multiday Event
              • background : calendarColor
              • symbol & text : white or black (oppositeColor) / oppositeColor is calculated by calendarColor to get more visibility by contrast.

            So, I think you are asking text of singleday event. To be honest, I don’t like the colorful text, so it is not considered in the default style.

            However, of course, you can override it.

            /* In your custom.css */
            .CX3 .event.singleday .headline .title,
            .CX3 .event.singleday .headline .time {
              color: var(--calendarColor);
            }
            

            Then you can get this.
            ebf942ae-b8dc-4fe5-aaae-0ab13db73a8a-image.png

            1 Reply Last reply Reply Quote 0
            • J Offline
              jlward73 @sdetweil
              last edited by Jan 28, 2024, 6:05 PM

              @sdetweil How do I do that? As I’m reading the posts from you and MMRIZE, I feel like the code is right in my default calendar and in the css file for CalendarExt3, but maybe the color property is not being broadcast, so I would like to check that.

              S M 2 Replies Last reply Jan 28, 2024, 9:21 PM Reply Quote 0
              • S Offline
                sdetweil @jlward73
                last edited by Jan 28, 2024, 9:21 PM

                @jlward73 look in the 3rd party modules list for one that shows the notifications in the developers window (ctrl-shift-i, select the console tab)

                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 @jlward73
                  last edited by Jan 29, 2024, 8:49 AM

                  @jlward73
                  https://github.com/MMRIZE/MMM-LogExt
                  You can track Frontend logs and notifications in the backend log with ease.

                  B 1 Reply Last reply Jan 29, 2024, 6:51 PM Reply Quote 0
                  • B Offline
                    BKeyport Module Developer @MMRIZE
                    last edited by Jan 29, 2024, 6:51 PM

                    Why aren’t you guys using the transformer?

                    eventTransformer: (ev) => {
                    					if (ev.title.search("🏠") > -1) {
                    						ev.title = ev.title.replace("🏠 Personal Commitment", "🏠 Personal Event");
                    						ev.color = 'yellow';
                    					}
                    					if (ev.title.search("✈ Flight") > -1) {
                    						ev.title = ev.title.replace("✈ Flight", "🏠 Personal Event");
                    						ev.color = 'yellow';
                    					}
                    					if (ev.title.search("busy") > -1) {
                    						ev.title = ev.title.replace("busy", "🏠 Mom Event");
                    						ev.color = 'yellow';
                    					}
                    					if (ev.title.search("Weekley") > -1) {
                    						ev.title = ev.title.replace("Weekley", "Weekly");
                    					}
                    					return ev
                    				}
                    

                    The "E" in "Javascript" stands for "Easy"

                    1 Reply Last reply Reply Quote 0
                    • Z Offline
                      ZiggidyZ
                      last edited by Jan 29, 2024, 6:59 PM

                      I understand 100% what you are saying, I had this same issue. What you are experiencing is the DEFAULT of CX3, that is how it looks if you don’t edit anything. By default the ICON next to the event will be the color you configured, but the event text will all be white. To change this you will need to edit your CUSTOM css file, DO NOT edit the css file inside of the module. I started off making that same mistake. The trouble in doing that, is that when a module gets updated, you lose anything you did. The customizations should be done in that custom.css file and should be backed up. Copy the code below into your ~MagicMirror/css/custom.css file, save, then refresh the browser window (I use the MMM-Remote-Control to refresh mine remotely), and you should see it load with the colors you configured in the default calendar module.

                      * CalendarExtende3 */
                      
                      /* Sets event titles to configured color */
                      .CX3A .event .description {
                        display: none;
                      }
                      
                      .CX3A .event .location {
                        display: none;
                      }
                      

                      I have 10 different calendars which my default calendar loads, all of which are displayed in CX3 with no issues.

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        4/15
                        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