Ashley M. Kirchner a4c02cef54 Absolute or Relative time display on Calendar module
User can now choose between an 'absolute' or 'relative time display on
events. Furthermore, when set to 'absolute', there's an option to set an
'urgency' range of days and only those events within that period will be
displayed with a relative time (in x days) while all others will have an
absolute date.
2016-05-10 01:01:00 -06:00
..
2016-05-03 17:01:48 +02:00
2016-05-10 00:46:21 -06:00
2016-04-05 15:43:52 -04:00
2016-05-03 11:56:24 +02:00
2016-04-20 11:32:48 +02:00

Module: Calendar

The calendar module is one of the default modules of the MagicMirror. This module displays events from a public .ical calendar. It can combine multiple calendars.

Using the module

To use this module, add it to the modules array in the config/config.js file:

modules: [
	{
		module: 'calendar',
		position: 'top_left',	// This can be any of the regions. Best results in left or right regions.
		config: {
			// The config property is optional.
			// If no config is set, an example calendar is shown.
			// See 'Configuration options' for more information.
		}
	}
]

Configuration options

The following properties can be configured:

Option Description
maximumEntries The maximum number of events shown.

Possible values: 0 - 100
Default value: 10
maximumNumberOfDays The maximum number of days in the future.

Default value: 365
displaySymbol Display a symbol in front of an entry.

Possible values: true or false
Default value: true
defaultSymbol The default symbol.

Possible values: See Font Awsome website.
Default value: calendar
maxTitleLength The maximum title length.

Possible values: 10 - 50
Default value: 25
fetchInterval How often does the content needs to be fetched? (Milliseconds)

Possible values: 1000 - 86400000
Default value: 300000 (5 minutes)
animationSpeed Speed of the update animation. (Milliseconds)

Possible values:0 - 5000
Default value: 2000 (2 seconds)
fade Fade the future events to black. (Gradient)

Possible values: true or false
Default value: true
fadePoint Where to start fade?

Possible values: 0 (top of the list) - 1 (bottom of list)
Default value: 0.25
calendars The list of calendars.

Possible values: An array, see calendar configuration below.
Default value: An example calendar.
titleReplace An object of textual replacements applied to the tile of the event. This allow to remove or replace certains words in the title.

Example:
			<code>
				titleReplace: {'Birthday of ' : '', 'foo':'bar'}
			</code>
		</td>
	</tr>
	<tr>
		<td><code>displayRepeatingCountTitle</code></td>
		<td>Show count title for yearly repeating events (e.g. "X. Birthday", "X. Anniversary")<br>
				
			<br><b>Possible values:</b> <code>true</code> or <code>false</code>
			<br><b>Default value:</b> <code>false</code>
		</td>
	</tr>	
	<tr>
		<td><code>timeFormat</code></td>
		<td>How to display the time on calendar events<br>
				
			<br><b>Possible values:</b> <code>relative</code> or <code>absolute</code>
			<br><b>Default value:</b> <code>relative</code>
		</td>
	</tr>	
	<tr>
		<td><code>urgency</code></td>
		<td>When .timeFormat is set to <code>absolute</code>, this option allows you to set a specific number of days from now to display as relative.<br>
		For example, if urgency is set to <code>5</code>, any events happening within those 5 days will be displayed as 'in x days'.<br>
		Any events outside of the urgency range will be displayed with an absolute date.<br>
		
			<br><b>Possible values:</b> <code>positive integer</code> for example <code>5</code> (for 5 days)
			<br><b>Default value:</b> <code>0</code>
		</td>
	</tr>	
</tbody>

Calendar configuration

The calendars property contains an array of the configured calendars.

Default value:

config: {
	calendars: [
		{
			url: 'http://www.calendarlabs.com/templates/ical/US-Holidays.ics',
			symbol: 'calendar',
		},
	],
}

Calendar configuration options:

Option Description
url The url of the calendar .ical. This property is required.

Possible values: Any public accessble .ical calendar.
symbol The symbol to show in front of an event. This property is optional.

Possible values: See Font Awsome website.
repeatingCountTitle The count title for yearly repating events in this calendar.

Example:
'Birthday'