diff --git a/CHANGELOG.md b/CHANGELOG.md
index ffb4e9c6..57a939e7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -53,6 +53,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Updated Norwegian translation.
- Added hideLoading option for News Feed module
- Added configurable dateFormat to clock module.
+- Added multiple calendar icon support.
### Fixed
- Update .gitignore to not ignore default modules folder.
diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md
index 655ab89c..0313a17f 100644
--- a/modules/default/calendar/README.md
+++ b/modules/default/calendar/README.md
@@ -72,8 +72,8 @@ config: {
| 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 Awesome](http://fontawesome.io/icons/) website.
-| `color` | The font color of an event from this calendar. This property should be set if the config is set to colored: true.
**Possible values:** HEX, RGB or RGBA values (#efefef, rgb(242,242,242), rgba(242,242,242,0.5)).
+| `symbol` | The symbol to show in front of an event. This property is optional.
**Possible values:** See [Font Awesome](http://fontawesome.io/icons/) website. To have multiple symbols you can define them in an array e.g. `["calendar", "plane"]`
+| `color` | The font color of an event from this calendar. This property should be set if the config is set to colored: true.
**Possible values:** HEX, RGB or RGBA values (#efefef, rgb(242,242,242), rgba(242,242,242,0.5)).
| `repeatingCountTitle` | The count title for yearly repating events in this calendar.
**Example:** `'Birthday'`
| `maximumEntries` | The maximum number of events shown. Overrides global setting. **Possible values:** `0` - `100`
| `maximumNumberOfDays` | The maximum number of days in the future. Overrides global setting
diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js
index 79e9edca..badbdcbd 100644
--- a/modules/default/calendar/calendar.js
+++ b/modules/default/calendar/calendar.js
@@ -138,10 +138,20 @@ Module.register("calendar", {
if (this.config.displaySymbol) {
var symbolWrapper = document.createElement("td");
- symbolWrapper.className = "symbol";
- var symbol = document.createElement("span");
- symbol.className = "fa fa-" + this.symbolForUrl(event.url);
- symbolWrapper.appendChild(symbol);
+ symbolWrapper.className = "symbol align-right";
+ var symbols = this.symbolsForUrl(event.url);
+ if(typeof symbols === "string") {
+ symbols = [symbols];
+ }
+
+ for(var i = 0; i < symbols.length; i++) {
+ var symbol = document.createElement("span");
+ symbol.className = "fa fa-" + symbols[i];
+ if(i > 0){
+ symbol.style.paddingLeft = "5px";
+ }
+ symbolWrapper.appendChild(symbol);
+ }
eventWrapper.appendChild(symbolWrapper);
}
@@ -331,14 +341,14 @@ Module.register("calendar", {
});
},
- /* symbolForUrl(url)
- * Retrieves the symbol for a specific url.
+ /* symbolsForUrl(url)
+ * Retrieves the symbols for a specific url.
*
* argument url string - Url to look for.
*
- * return string - The Symbol
+ * return string/array - The Symbols
*/
- symbolForUrl: function (url) {
+ symbolsForUrl: function (url) {
return this.getCalendarProperty(url, "symbol", this.config.defaultSymbol);
},
@@ -376,7 +386,7 @@ Module.register("calendar", {
getCalendarProperty: function (url, property, defaultValue) {
for (var c in this.config.calendars) {
var calendar = this.config.calendars[c];
- if (calendar.url === url && typeof calendar[property] === "string") {
+ if (calendar.url === url && calendar.hasOwnProperty(property)) {
return calendar[property];
}
}