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 - wrong icon shown in legend

    Scheduled Pinned Locked Moved Utilities
    1 Posts 1 Posters 352 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.
    • L Offline
      LeDan82
      last edited by

      Hi @all

      I have an issue with the icons/symbols, that are shown in the legend. Sometimes the legend shows an icon of the event (eventTransformer) instead of the default-calendar-icon. I am using iconify icons.

      For a better understanding please have a look at the screenshot:
      e.g. the yellow calendar. The default icon should be a brick-head one. You can find it e.g. on Monday at “LAC Training”. The Legend instead shows the bread icon. I am using the bread-icon via eventTransformer only for events that calls “Brotbüchse”.
      Why the legend shows this icon instead of the default one?

      CalendarExt3.jpeg

      Here the main code of the calendar module:

                      {
                              module: "calendar",
                              header: "TErmINe",
                              //position: "top_left",
                              config: {
                                      defaultSymbolClassName: '',
                                      useIconify: true,
                                      broadcastPastEvents: true, 
                                      calendars: [
                                              {
                                                      name: "Ludwig", 
                                                      color: "#CD2626",
                                                      fetchInterval: 5 * 60 * 1000,
                                                      symbol: "game-icons:trumpet",
                                                      url: "webcal:"
                                              },
                                              {
                                                      name: "Albrecht",
                                                      color: "#EEEE00",
                                                      fetchInterval: 5 * 60 * 1000,
                                                      symbol: "ph:lego-smiley-light",
                                                      url: "webcal:"
                                              },
                                              {
                                                      name: "Samuel",
                                                      color: "#4876FF",
                                                      symbol: "healthicons:running",
                                                      fetchInterval: 5 * 60 * 1000,
                                                      url: "webcal:"
                                              },
                                              {
                                                      name: "Abfall",
                                                      color: "#919191",
                                                      symbol: "solar:trash-bin-minimalistic-outline",
                                                      fetchInterval: 5 * 60 * 1000,
                                                      url: "webcal://localhost:8080/"
                                              },
                                              {
                                                      name: "Franziska",
                                                      symbol: "fluent-emoji-high-contrast:unicorn",
                                                      /*color: "#800080",*/
                                                      color: "#E066FF",
                                                      fetchInterval: 5 * 60 * 1000,
                                                      url: "webcal:"
                                              },
                                             {
                                                      name: "Daniel",
                                                      color: '#008000',
                                                      symbol: "game-icons:full-motorcycle-helmet",
                                                      fetchInterval: 5 * 60 * 1000,
                                                      url: "webcal:"
                                              },
                                              {
                                                      name: "Familie",
                                                      color: "#FF8C00",
                                                      symbol: "material-symbols:family-restroom",
                                                      fetchinterval: 5 * 60 * 1000,
                                                      url: "webcal:"
                                              },
                                              {
                                                      name: "Jahrestage",
                                                      color: "#622C00",
                                                      symbol: "iconoir:birthday-cake",
                                                      fetchInterval: 5 * 60 * 1000,
                                                      url: "webcal:"
                                              }
                                      ]
                              }
                      },
      

      Here you can find the config of the CalendarExt3 module:

                      {
                              module: "MMM-CalendarExt3",
                              position: "upper_third",
                              header: "14-Tage Vorschau",
                              title: "14 Tage Übersicht",
                              config: {
                                      refreshInterval: 5 * 60 * 1000,
                                      useIconify: true,
                                      mode: "week",
                                      displayLegend: true,
                                      displayEndTime: false,
                                      weekIndex: 0,
                                      weeksInView: 2,
                                      instanceId: "basicCalendar",
                                      locale: 'de-DE',
                                      useMarquee: true,
                                      maxEventLines: 7,
                                      fontSize: '17px',
                                      eventHeight: '40px',
                                      firstDayOfWeek: 1,
                                      useWeather: false,
                                      showMore: true,
                                      skipDuplicated: false,
                                      calendarSet: ['Ludwig', 'Samuel', 'Albrecht', 'Daniel','Franziska', 'Familie', 'Abfall', 'Jahrestage'],
      
                                      eventTransformer: (ev) => {
                                              if (ev.title.search('Saxophon') > -1) ev.symbol = ["game-icons:saxophone"]
                                              if (ev.title.search('Brotbüchse') > -1) ev.symbol = ["ph:bread"]
                                              if (ev.title.search('Sport Vorschule') > -1) ev.symbol = ["solar:bottle-outline"]
                                              if (ev.title.search('Jugendfeuerwehr') > -1) ev.symbol = ["ph:siren-light"]
                                              if (ev.title.search('Gitarre') > -1) ev.symbol = ["ph:guitar-light"]
                                              if (ev.title.search('Geburtstag') > -1) ev.symbol = ["simple-line-icons:present"]
                                              if (ev.title.search('GTA Fußball') > -1) ev.symbol = ["game-icons:soccer-ball"]
                                              if (ev.title.search('GTA Handball') > -1) ev.symbol = ["mdi:handball"]
                                              if (ev.title.search('Treffen') > -1) ev.symbol = ["tabler:pacman"]
                                              if (ev.title.search('FT:') > -1) ev.symbol = ["ion:calendar-outline"]
                                              return ev
                                      }
                              }
                      },
      

      Can you help to find the the root cause of the problem?

      1 Reply Last reply Reply Quote 0
      • C czabel referenced this topic on

      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