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.

    Calendar customization

    Scheduled Pinned Locked Moved Troubleshooting
    6 Posts 3 Posters 5.4k 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.
    • O Offline
      onetwankyfive
      last edited by

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

      D 1 Reply Last reply Reply Quote 0
      • D Offline
        DelPhinDot @onetwankyfive
        last edited by

        @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",
        		},
        
        1 Reply Last reply Reply Quote 0
        • D Offline
          DelPhinDot
          last edited by

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

          1 Reply Last reply Reply Quote 1
          • brobergB Offline
            broberg Project Sponsor
            last edited by

            Try setting the urgency var to 0

            D 1 Reply Last reply Reply Quote 0
            • D Offline
              DelPhinDot @broberg
              last edited by

              @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();
              					}
              
              1 Reply Last reply Reply Quote 0
              • 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