• 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.

Default Calendar Custom Events

Scheduled Pinned Locked Moved Solved Troubleshooting
11 Posts 2 Posters 663 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.
  • D Offline
    doogy_rev
    last edited by Oct 30, 2024, 7:43 PM

    Hi All,

    I am looking to create a custom event for the default calendar and I can’t get the example in the guide to work.

    https://docs.magicmirror.builders/modules/calendar.html#configuration-options

    Here is my code …

    {
    			module: "calendar",
    			header: "Celebrations",
    			position: "top_left",
    			config: {
    				calendars: [
    					{
    						fetchInterval: 7 * 24 * 60 * 60 * 1000,
    						symbol: "calendar-check",
    						maximumEntries: "8",
    						customEvents: [{keyword: 'Birthday', symbol: 'birthday-cake', color: 'Gold', transform: { search: '^([^\']*) \'(\\d{4})$', replace: '$1 ($2.)', yearmatchgroup: 2}}],
    						url: "https://calendar.google.comxxxxxxxxxxxxxxxxxxxxxxxxxbasic.ics"
    					}
    				]
    			}
    		},	
    

    No matter what I try I can’t get the symbols to change to the cake icon or have the birth year transformed to the persons age.

    All my calendar events are titled “DoogyRev Birthday '1982” a per the example. Has any one got this to work? any suggestions welcome.

    Thanks

    DoogyRev

    S 1 Reply Last reply Oct 30, 2024, 8:09 PM Reply Quote 0
    • S Offline
      sdetweil @doogy_rev
      last edited by sdetweil Oct 31, 2024, 12:31 AM Oct 31, 2024, 12:10 AM

      @doogy_rev url is part of the event {} object

      { url:… same as in calendar def, symbol:…, color:… keyword:, …}

      the url is needed cause you could have 10 calendars defined. which calendar should this customEvent thing apply to, as there is only one customEvents list for this module instance

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @doogy_rev
        last edited by sdetweil Oct 30, 2024, 8:10 PM Oct 30, 2024, 8:09 PM

        @doogy_rev customEvents list is OUTSIDE the calendars:[] list

        that is why you have to supply the url to match which calendar events to affect

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • D Offline
          doogy_rev
          last edited by doogy_rev Oct 30, 2024, 9:27 PM Oct 30, 2024, 9:14 PM

          @sdetweil When I put it outside the Calendar:[] I can’t get it to load.

          Do you have a example how it should look, I have searched other posts relating to custom events but can’t suss it.

          Apologies I am a noob at this :-)

          S 1 Reply Last reply Oct 30, 2024, 9:33 PM Reply Quote 0
          • S Offline
            sdetweil @doogy_rev
            last edited by Oct 30, 2024, 9:33 PM

            @doogy_rev i posted this in discord the other day

            in calendar you can have multiple url sources of events that will be merged together in one output.

            now
            customEvents is a list []
            each entry
            has a url: property to match it to the url config in the calendars list[]
            then properties for the individual items for that url
            keyword
            symbol
            color

            keyword is the text in the event summary to match to specific events
            so each entry is (with the array/list marker)

            customEvents:
            [
              {  url, keyword,  symbol, color },
              {another},
              {another}
            ]
            

            example layout

            {
               module:'calendar',
               position:'...',
               config:{
                     customEvents:[
                               {},
                               {}
                      ],
                      calendars:[
                          {},
                           {}
                      }
                  }
            }
            

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • D Offline
              doogy_rev
              last edited by Oct 30, 2024, 10:25 PM

              @sdetweil This is useful, thanks. Based on that I now have this…

              		{
              			module: "calendar",
              			header: "Celebrations",
              			position: "top_left",
              			config: {
              				colored: true,
              				customEvents: [
              					{keyword: 'Birthday', symbol: 'birthday-cake', color: 'Gold'},
              					{transform: { search: '^([^\']*) \'(\\d{4})$', replace: '$1 ($2.)', yearmatchgroup: 2}}
              				],
              				calendars: [
              					{
              						fetchInterval: 7 * 24 * 60 * 60 * 1000,
              						symbol: "calendar-check",
              						maximumEntries: "8",
              						url: "https://calendar.google.com/xxxxxxxxxxxxxxxxxxxxxxxxx/basic.ics"
              					}
              				]		
              			}
              		},
              

              I can get the colours working if I comment out the transform. as soon as I enable that calendar does not load. Can you see any errors in the transform string?

              Thanks

              S 1 Reply Last reply Oct 30, 2024, 11:06 PM Reply Quote 0
              • S Offline
                sdetweil @doogy_rev
                last edited by Oct 30, 2024, 11:06 PM

                @doogy_rev i don’t know about transom, i thought that was only for ext3.

                and you didn’t put in the url

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • D Offline
                  doogy_rev
                  last edited by Oct 30, 2024, 11:16 PM

                  @sdetweil Where am I supposed to put the calendar URL in again? not sure I am understanding.

                  S 1 Reply Last reply Oct 31, 2024, 12:10 AM Reply Quote 0
                  • S Offline
                    sdetweil @doogy_rev
                    last edited by sdetweil Oct 31, 2024, 12:31 AM Oct 31, 2024, 12:10 AM

                    @doogy_rev url is part of the event {} object

                    { url:… same as in calendar def, symbol:…, color:… keyword:, …}

                    the url is needed cause you could have 10 calendars defined. which calendar should this customEvent thing apply to, as there is only one customEvents list for this module instance

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      doogy_rev
                      last edited by Oct 31, 2024, 12:46 AM

                      Got it, Thank you! @sdetweil

                      S 2 Replies Last reply Oct 31, 2024, 2:12 AM Reply Quote 0
                      • S Offline
                        sdetweil @doogy_rev
                        last edited by Oct 31, 2024, 2:12 AM

                        @doogy_rev cool

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        1 Reply Last reply Reply Quote 0
                        • S sdetweil has marked this topic as solved on Oct 31, 2024, 2:12 AM
                        • 1
                        • 2
                        • 1 / 2
                        1 / 2
                        • First post
                          3/11
                          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