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-CalendarExt2 - show calendar name in event

    Scheduled Pinned Locked Moved Troubleshooting
    4 Posts 3 Posters 739 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.
    • B Offline
      buggynets
      last edited by

      Hi folks,

      I have looked through the MMM-CalendarExt2 config and style documents and haven’t spotted a way to prepend an event with its originating calendar:

      So instead of

      Math class
      Science class

      I’d like it to show:

      Jane: Math class
      John: Science class

      Depending on whether the event came from Jane or John’s google calendar ics.

      Thanks!

      BKeyportB S 2 Replies Last reply Reply Quote 0
      • BKeyportB Offline
        BKeyport Module Developer @buggynets
        last edited by

        @buggynets

        look into the transform function.

        https://github.com/MMM-CalendarExt2/MMM-CalendarExt2/blob/master/docs/Filtering-and-Sorting.md

        You’ll have to figure out if there’s an event tag you can grab off of, but, here’s the basic concept (I have my system setting CSS classes based on keywords)

        transform: function(event) {
        	if (event.title.search("Recycle") > -1) {
        			event.icon = "mdi:recycle";
                 		event.className = "lemay";
        		}
        	if (event.title.search("Yard Waste") > -1) {
        			event.icon = "entypo-leaf";
        			event.className = "lemay";
        		}
        	if (event.title.search("Trash") > -1) {
        			event.icon = "bi:trash";
        			event.className = "lemay";
        		}
        	if (event.title.search("Seahawks") > -1) {
        			event.icon = "fa-solid:football-ball";
        			event.className = "seahawks";
        		}
        	if (event.title.search("Sounders") > -1) {
        			event.icon = "noto:soccer-ball";
        			event.className = "sounders";
        		}
        	return event;
        },
        

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

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

          @buggynets where would u get the name from?

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          B 1 Reply Last reply Reply Quote 0
          • B Offline
            buggynets @sdetweil
            last edited by

            @sdetweil

            I would get it from the “name:” that I assigned to that particular calendar in the config document. Right now each row in my display only gives the name of the event from the Google Calendar. I have styled the various calendars to have different colors, but it would be great to also preface that source name for the feed in the event description.

            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