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.

    *REQUEST* how to make calendar event colored according to title string found?

    Scheduled Pinned Locked Moved Custom CSS
    3 Posts 2 Posters 1.0k Views 2 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
      M1st3r-E
      last edited by

      using MMM-CalendarExt2 (but im sure some things are done the same…)
      so i was able to add multiple calendars but one specific calendar is a “shared” calendar and cannot use the option --> .CX2 .event.sharedCalName and assign a color as all events will grab this same color… i found that .event.[data-calendar-name=“xx”] works for specific Cal names but this is by calendar… i want to do this by calendar event and cannot find the appropriate string… does this option even exist? if so, can someone provide it? i.e. for calendar event starting with “E:” color blue while events starting with “M:” color pink, etc… tnx

      M 1 Reply Last reply Reply Quote 0
      • M Offline
        MMRIZE @M1st3r-E
        last edited by MMRIZE

        @M1st3r-E
        You can use transforming in view configuration.

        transform: (event) => {
          if (event.title.search("Birthday") > -1) { // If the event might include "Birthday" in its title,
            event.className = "BirthdayTitle"; // Assign new CSS class name of that event to "BirthdayTitle"
          }
          return event; // Return that event.
        };
        

        event object could have these properties;

        calendarId: 1;
        calendarName: "Tottenham";
        className: "mySoccerClass";
        description: "FA Cup, round 3";
        duration: 7200;
        endDate: "1546638300";
        endDateJ: "2019-01-04T21:45:00.000Z";
        icon: "noto-soccer-ball";
        isFullday: false;
        isMoment: false;
        isOneday: true;
        isPassed: false;
        isRecurring: false;
        isCancelled: false;
        location: "";
        startDate: "1546631100";
        startDateJ: "2019-01-04T19:45:00.000Z";
        title: "Team T.B.A. - Tottenham Hotspur";
        uid: "1:1546631100:1546638300:op54vk5s1r0ivl8i165ampip88@google.com";
        ms_busystatus: "BUSY"; // Only for calendar from MS Outlook. Available : "BUSY", "FREE", "TENTATIVE", "OOF"
        
        M 1 Reply Last reply Reply Quote 0
        • M Offline
          M1st3r-E @MMRIZE
          last edited by

          @MMRIZE tnx alot mate

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 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