MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. Subintro
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    S
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 13
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: CALENDAR_EVENTS not broadcasting? MMM-Calendarweek

      And you’re using the MMM-Calendarweek module? Does my notificationReceived look like it should be working to you?

      posted in Troubleshooting
      S
      Subintro
    • CALENDAR_EVENTS not broadcasting? MMM-Calendarweek

      Hey so I’m trying to make an app do something if it receives the notification ‘CALENDAR_EVENTS’ from the calendar.

      So far its not doing anything. I tried to use the alert module but I get nothing from that either. If MMM-CalendarWeek isnt properly working with broadcasts, is there a way to set up the stock calendar module to work in the background?

      My code is here

      	// Default module config.
      	defaults: {
      		this.hide(),
      	text: "Calendar alert receieved!"
      		
      	},
      	notificationReceived: function(notification, payload, sender) {
      				if (notification === 'CALENDAR_EVENTS') {
      				var x = payload,
      				for (let value of x) {
      					this.show(),
      				var startTime = new Date(startDate),
      				var endTime = new Date(endDate),
      				var ms = (endTime.getTime() - startTime.getTime()) / 1000,
      				setTimeout(function(){
      					this.hide()
      					}, ms),				
      				}
      	        
             }
         },
      
      	// Override dom generator.
      	getDom: function() {
      		var wrapper = document.createElement("div");
      		wrapper.innerHTML = this.config.text;
      		return wrapper;
      	}
      });
      posted in Troubleshooting
      S
      Subintro
    • 1 / 1