mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Merge pull request #1424 from thobach/develop
Allow to parse recurring calendar events where the start date is before 1900
This commit is contained in:
commit
cec1f12918
@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- Screenshot for the weather forecast module
|
- Screenshot for the weather forecast module
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Allow to parse recurring calendar events where the start date is before 1900
|
||||||
- Fixed Polish translation for Single Update Info
|
- Fixed Polish translation for Single Update Info
|
||||||
|
|
||||||
### Updated
|
### Updated
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
# Module: Calendar
|
# Module: Calendar
|
||||||
The `calendar` module is one of the default modules of the MagicMirror.
|
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.
|
This module displays events from a public .ical calendar. It can combine multiple calendars.
|
||||||
Note that calendars may not contain any entry before 1st January 1970, otherwise the calendar won't be displayed and the module will crash.
|
|
||||||
|
|
||||||
## Using the module
|
## Using the module
|
||||||
|
|
||||||
|
@ -173,6 +173,14 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
|
|||||||
|
|
||||||
if (typeof event.rrule != "undefined" && !isFacebookBirthday) {
|
if (typeof event.rrule != "undefined" && !isFacebookBirthday) {
|
||||||
var rule = event.rrule;
|
var rule = event.rrule;
|
||||||
|
|
||||||
|
// can cause problems with e.g. birthdays before 1900
|
||||||
|
if(rule.origOptions && rule.origOptions.dtstart && rule.origOptions.dtstart.getFullYear() < 1900 ||
|
||||||
|
rule.options && rule.options.dtstart && rule.options.dtstart.getFullYear() < 1900){
|
||||||
|
rule.origOptions.dtstart.setYear(1900);
|
||||||
|
rule.options.dtstart.setYear(1900);
|
||||||
|
}
|
||||||
|
|
||||||
var dates = rule.between(today, future, true, limitFunction);
|
var dates = rule.between(today, future, true, limitFunction);
|
||||||
|
|
||||||
for (var d in dates) {
|
for (var d in dates) {
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
"mocha-logger": "^1.0.6",
|
"mocha-logger": "^1.0.6",
|
||||||
"moment": "latest",
|
"moment": "latest",
|
||||||
"request": "^2.87.0",
|
"request": "^2.87.0",
|
||||||
"rrule-alt": "^2.2.7",
|
"rrule-alt": "^2.2.8",
|
||||||
"simple-git": "^1.85.0",
|
"simple-git": "^1.85.0",
|
||||||
"socket.io": "^2.1.1",
|
"socket.io": "^2.1.1",
|
||||||
"valid-url": "latest",
|
"valid-url": "latest",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user