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

Scheduled Pinned Locked Moved Troubleshooting
4 Posts 3 Posters 727 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 Feb 15, 2021, 6:22 PM

    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!

    B S 2 Replies Last reply Feb 15, 2021, 6:47 PM Reply Quote 0
    • B Offline
      BKeyport Module Developer @buggynets
      last edited by Feb 15, 2021, 6:47 PM

      @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 Feb 15, 2021, 7:21 PM

        @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 Feb 16, 2021, 3:01 AM Reply Quote 0
        • B Offline
          buggynets @sdetweil
          last edited by Feb 16, 2021, 3:01 AM

          @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
          1 / 1
          • First post
            4/4
            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