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

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 Dec 27, 2016, 11:39 PM

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

    D 1 Reply Last reply Dec 27, 2016, 11:47 PM Reply Quote 0
    • D Offline
      DelPhinDot @onetwankyfive
      last edited by Dec 27, 2016, 11:47 PM

      @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 Dec 28, 2016, 12:43 AM

        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
        • B Offline
          broberg Project Sponsor
          last edited by Dec 28, 2016, 4:55 AM

          Try setting the urgency var to 0

          D 1 Reply Last reply Dec 28, 2016, 2:20 PM Reply Quote 0
          • D Offline
            DelPhinDot @broberg
            last edited by Dec 28, 2016, 2:20 PM

            @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
            1 / 1
            • First post
              6/6
              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