Calendar customization



  • I’ve just started to modify my mirror after getting it up n’ running.
    When i wanted to change the time format and remove the fade of the calendar i added the dateFormat and fade tags.
    But it doesn’t seem to do anything when i fire up the magic mirror…

    Anyone that’d like to help a noob in need, would be greatly appreciated!

    		{
    			module: 'calendar',
    			header: 'Schema',
    			position: 'bottom_center',
    			config: {
    
    				dateFormat: 'YYYY-MM-DD HH:mm',
    				fade: 'false',
    
    				calendars: [
    					{
    						symbol: 'calendar-check-o ',
    						url: 'https://www.schoolity.se/icalendar?id=c72fb38200f647302d97cc2384dc8ac247736f4078d3c3f01eeeabe5c56d2ff78d01961bda23a247'
    					}
    				]
    			}
    		},
    


  • this is done in the calendar.js file
    MagicMirror/modules/default/calendar/calendar.js



  • @onetwankyfive Ah i see, i tested to edit the calendar.js now instead. But it still doesn’t change the date so that i can see the exact time of the event in the calendar… Any tip?

    * global Module */
    
    /* Magic Mirror
     * Module: Calendar
     *
     * By Michael Teeuw http://michaelteeuw.nl
     * MIT Licensed.
     */
    
    Module.register("calendar",{
    
    	// Define module defaults
    	defaults: {
    		maximumEntries: 10, // Total Maximum Entries
    		maximumNumberOfDays: 365,
    		displaySymbol: true,
    		defaultSymbol: "calendar", // Fontawesome Symbol see http://fontawesome.io/cheatsheet/
    		displayRepeatingCountTitle: false,
    		defaultRepeatingCountTitle: '',
    		maxTitleLength: 25,
    		fetchInterval: 5 * 60 * 1000, // Update every 5 minutes.
    		animationSpeed: 2000,
    		fade: true,
    		urgency: 7,
    		timeFormat: "absolute",
    		dateFormat: 'YYYY-MM-DD HH:mm',
    		fadePoint: 0.25, // Start on 1/4th of the list.
    		calendars: [
    			{
    				symbol: "calendar",
    
    			url: "http://www.calendarlabs.com/templates/ical/US-Holidays.ics",
    		},


  • I’m looking to make the events formatted like this “[eventname] [Month] [Day] [Time]” ex. “Physics Class Jan 11 08:11”


  • Module Developer

    Try setting the urgency var to 0



  • @broberg Thanks, i had changed the urgency to 0 after seeing what it did. Now i just had to solve the problem that all events within 6h would say “in 2 hours” instead of displaying the actual event time… After a bit of searching in the code i found this section: if (event.startDate - now < 6 * one_hour) and changed it to if (event.startDate - now < 1 * one_hour) , hence the calendar wold display the exact time not the time untill. (see code below)
    calendar.js

    			if (event.startDate >= new Date()) {
    				if (event.startDate - now < 2 * one_day) {
    					// This event is within the next 48 hours (2 days)
    					if (event.startDate - now < 1 * one_hour) {
    						// If event is within 1 hour, display 'in xxx' time format or moment.fromNow()
    						timeWrapper.innerHTML = moment(event.startDate, "x").fromNow();
    					} else {
    						// Otherwise just say 'Today/Tomorrow at such-n-such time'
    						timeWrapper.innerHTML = moment(event.startDate, "x").calendar();
    					}

Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.