MagicMirror² v2.12.0 is available! For more information about this release, check out this topic.

Exclude certain events from Calendar



  • I am trying to exclude certain events from a calendar. The event is called Workout. I have dabbled quite a bit with the excludedEvents command, but have had no luck. Could someone please help me with the syntax to simply exclude events that contain the word Workout in the title? I have tried the below and many other combinations with no success. I put the command in the config.js file within the calendar config. I have not receive JS errors. It just does nothing.

    excludedEvents [ 'Workout'],
    

  • Project Sponsor

    @theaddies said in Exclude certain events from Calendar:

    excludedEvents [ ‘Workout’],

    I might be wrong but I think you might be missing a colon. It should read like this: excludedEvents: [ 'Workout'],



  • Unfortunately that wasn’t it. I had the : in the code. It isn’t clear to me whether the command should be in the calendar part of config.js or the default settings of calendar.js. The code below, that doesn’t work, is from the config.js.

                     {
                             module: "calendar",
                             header: "Work",
                             position: "top_left",
                             config: {
                                     maximumEntries: '5',
                                     excludedEvents: ["Workout"],
                                     calendars: [
                                                     symbol: "briefcase", url:https:www.mywebsite.com
                                                     auth: {
                                                             user: 'xxxx',
                                                             pass: 'xxxxxxx',
                                                             method: 'basic'
                                                             }
                                                     ]
                                         }
                          }
    
    

  • Project Sponsor

    @theaddies

                     {
                             module: "calendar",
                             header: "Work",
                             position: "top_left",
                             config: {
                                     maximumEntries: '5',
                                     excludedEvents: [ {filterBy: 'Workout', caseSensitive: false} ],
                                     calendars: [
                                                      url: 'https:www.mywebsite.com',
                                                     symbol: 'briefcase', 
                                                     auth: {
                                                             user: 'xxxx',
                                                             pass: 'xxxxxxx',
                                                             method: 'basic'
                                                             }
                                                     ]
                                         }
                          }
    

Log in to reply