mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-28 17:08:09 +00:00
* Worked around several issues in the RRULE library that were causing deleted calender events to still show, some initial and recurring events to not show, and some event times to be off an hour. (#3291) * Renamed variables in *calendarfetcherutils.js* to be more clear about use of `moment` and js's `Date` class. * Added calendar config option `forceUseCurrentTime` (default:`false`) which will ignore overridden `Date.now` in the config in order to keep some tests consistent. * Added several unit tests for crossing DST in different timezones with excluded events.
This commit is contained in:
@@ -7,6 +7,7 @@ let config = {
|
||||
position: "bottom_bar",
|
||||
config: {
|
||||
customEvents: [{ keyword: "CustomEvent", symbol: "dice", eventClass: "undo" }],
|
||||
forceUseCurrentTime: true,
|
||||
calendars: [
|
||||
{
|
||||
maximumEntries: 5,
|
||||
|
@@ -1,31 +0,0 @@
|
||||
/* NOTE: calendar_test_exdate.ics has exdate entries for the next 20 years, but without some
|
||||
* way to set a debug date for tests, this test may become flaky on specific days (i.e. could
|
||||
* not test easily on leap-years, the BYDAY specified in exdate, etc.) or when the 20 years
|
||||
* elapses if this project is still in active development ;)
|
||||
* See issue #3250
|
||||
*/
|
||||
let config = {
|
||||
timeFormat: 12,
|
||||
|
||||
modules: [
|
||||
{
|
||||
module: "calendar",
|
||||
position: "bottom_bar",
|
||||
config: {
|
||||
maximumEntries: 100,
|
||||
calendars: [
|
||||
{
|
||||
maximumEntries: 100,
|
||||
maximumNumberOfDays: 364,
|
||||
url: "http://localhost:8080/tests/mocks/calendar_test_exdate.ics"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||
if (typeof module !== "undefined") {
|
||||
module.exports = config;
|
||||
}
|
37
tests/configs/modules/calendar/exdate_la_at_midnight_dst.js
Normal file
37
tests/configs/modules/calendar/exdate_la_at_midnight_dst.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/* MagicMirror² Test calendar exdate
|
||||
*
|
||||
* By jkriegshauser
|
||||
* MIT Licensed.
|
||||
*
|
||||
* See issue #3250
|
||||
* See tests/electron/modules/calendar_spec.js
|
||||
*/
|
||||
let config = {
|
||||
timeFormat: 12,
|
||||
|
||||
modules: [
|
||||
{
|
||||
module: "calendar",
|
||||
position: "bottom_bar",
|
||||
config: {
|
||||
maximumEntries: 100,
|
||||
calendars: [
|
||||
{
|
||||
maximumEntries: 100,
|
||||
maximumNumberOfDays: 28, // 4 weeks, 2 of which are skipped
|
||||
url: "http://localhost:8080/tests/mocks/exdate_la_at_midnight_dst.ics"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
Date.now = () => {
|
||||
return new Date("19 Oct 2023 12:30:00 GMT-07:00").valueOf();
|
||||
};
|
||||
|
||||
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||
if (typeof module !== "undefined") {
|
||||
module.exports = config;
|
||||
}
|
37
tests/configs/modules/calendar/exdate_la_at_midnight_std.js
Normal file
37
tests/configs/modules/calendar/exdate_la_at_midnight_std.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/* MagicMirror² Test calendar exdate
|
||||
*
|
||||
* By jkriegshauser
|
||||
* MIT Licensed.
|
||||
*
|
||||
* See issue #3250
|
||||
* See tests/electron/modules/calendar_spec.js
|
||||
*/
|
||||
let config = {
|
||||
timeFormat: 12,
|
||||
|
||||
modules: [
|
||||
{
|
||||
module: "calendar",
|
||||
position: "bottom_bar",
|
||||
config: {
|
||||
maximumEntries: 100,
|
||||
calendars: [
|
||||
{
|
||||
maximumEntries: 100,
|
||||
maximumNumberOfDays: 28, // 4 weeks, 2 of which are skipped
|
||||
url: "http://localhost:8080/tests/mocks/exdate_la_at_midnight_std.ics"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
Date.now = () => {
|
||||
return new Date("19 Oct 2023 12:30:00 GMT-07:00").valueOf();
|
||||
};
|
||||
|
||||
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||
if (typeof module !== "undefined") {
|
||||
module.exports = config;
|
||||
}
|
37
tests/configs/modules/calendar/exdate_la_before_midnight.js
Normal file
37
tests/configs/modules/calendar/exdate_la_before_midnight.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/* MagicMirror² Test calendar exdate
|
||||
*
|
||||
* By jkriegshauser
|
||||
* MIT Licensed.
|
||||
*
|
||||
* See issue #3250
|
||||
* See tests/electron/modules/calendar_spec.js
|
||||
*/
|
||||
let config = {
|
||||
timeFormat: 12,
|
||||
|
||||
modules: [
|
||||
{
|
||||
module: "calendar",
|
||||
position: "bottom_bar",
|
||||
config: {
|
||||
maximumEntries: 100,
|
||||
calendars: [
|
||||
{
|
||||
maximumEntries: 100,
|
||||
maximumNumberOfDays: 28, // 4 weeks, 2 of which are skipped
|
||||
url: "http://localhost:8080/tests/mocks/exdate_la_before_midnight.ics"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
Date.now = () => {
|
||||
return new Date("19 Oct 2023 12:30:00 GMT-07:00").valueOf();
|
||||
};
|
||||
|
||||
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||
if (typeof module !== "undefined") {
|
||||
module.exports = config;
|
||||
}
|
37
tests/configs/modules/calendar/exdate_syd_at_midnight_dst.js
Normal file
37
tests/configs/modules/calendar/exdate_syd_at_midnight_dst.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/* MagicMirror² Test calendar exdate
|
||||
*
|
||||
* By jkriegshauser
|
||||
* MIT Licensed.
|
||||
*
|
||||
* See issue #3250
|
||||
* See tests/electron/modules/calendar_spec.js
|
||||
*/
|
||||
let config = {
|
||||
timeFormat: 12,
|
||||
|
||||
modules: [
|
||||
{
|
||||
module: "calendar",
|
||||
position: "bottom_bar",
|
||||
config: {
|
||||
maximumEntries: 100,
|
||||
calendars: [
|
||||
{
|
||||
maximumEntries: 100,
|
||||
maximumNumberOfDays: 28, // 4 weeks, 2 of which are skipped
|
||||
url: "http://localhost:8080/tests/mocks/exdate_syd_at_midnight_dst.ics"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
Date.now = () => {
|
||||
return new Date("14 Sep 2023 12:30:00 GMT+10:00").valueOf();
|
||||
};
|
||||
|
||||
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||
if (typeof module !== "undefined") {
|
||||
module.exports = config;
|
||||
}
|
37
tests/configs/modules/calendar/exdate_syd_at_midnight_std.js
Normal file
37
tests/configs/modules/calendar/exdate_syd_at_midnight_std.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/* MagicMirror² Test calendar exdate
|
||||
*
|
||||
* By jkriegshauser
|
||||
* MIT Licensed.
|
||||
*
|
||||
* See issue #3250
|
||||
* See tests/electron/modules/calendar_spec.js
|
||||
*/
|
||||
let config = {
|
||||
timeFormat: 12,
|
||||
|
||||
modules: [
|
||||
{
|
||||
module: "calendar",
|
||||
position: "bottom_bar",
|
||||
config: {
|
||||
maximumEntries: 100,
|
||||
calendars: [
|
||||
{
|
||||
maximumEntries: 100,
|
||||
maximumNumberOfDays: 28, // 4 weeks, 2 of which are skipped
|
||||
url: "http://localhost:8080/tests/mocks/exdate_syd_at_midnight_std.ics"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
Date.now = () => {
|
||||
return new Date("14 Sep 2023 12:30:00 GMT+10:00").valueOf();
|
||||
};
|
||||
|
||||
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||
if (typeof module !== "undefined") {
|
||||
module.exports = config;
|
||||
}
|
37
tests/configs/modules/calendar/exdate_syd_before_midnight.js
Normal file
37
tests/configs/modules/calendar/exdate_syd_before_midnight.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/* MagicMirror² Test calendar exdate
|
||||
*
|
||||
* By jkriegshauser
|
||||
* MIT Licensed.
|
||||
*
|
||||
* See issue #3250
|
||||
* See tests/electron/modules/calendar_spec.js
|
||||
*/
|
||||
let config = {
|
||||
timeFormat: 12,
|
||||
|
||||
modules: [
|
||||
{
|
||||
module: "calendar",
|
||||
position: "bottom_bar",
|
||||
config: {
|
||||
maximumEntries: 100,
|
||||
calendars: [
|
||||
{
|
||||
maximumEntries: 100,
|
||||
maximumNumberOfDays: 28, // 4 weeks, 2 of which are skipped
|
||||
url: "http://localhost:8080/tests/mocks/exdate_syd_before_midnight.ics"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
Date.now = () => {
|
||||
return new Date("14 Sep 2023 12:30:00 GMT+10:00").valueOf();
|
||||
};
|
||||
|
||||
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||
if (typeof module !== "undefined") {
|
||||
module.exports = config;
|
||||
}
|
Reference in New Issue
Block a user