MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    MMM-CalendarExt2 - show calendar name in event

    Troubleshooting
    3
    4
    350
    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
      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!

      BKeyport S 2 Replies Last reply Reply Quote 0
      • BKeyport
        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
          sdetweil @buggynets last edited by

          @buggynets where would u get the name from?

          Sam

          Create a working config
          How to add modules

          B 1 Reply Last reply Reply Quote 0
          • B
            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 Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy