mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-07 16:11:14 +00:00
parent
90ff3402cb
commit
1a745cfb92
@ -39,6 +39,7 @@ _This release is scheduled to be released on 2024-04-01._
|
|||||||
- [newsfeed] Fix newsfeed stall issue introduced by #3336 (#3361)
|
- [newsfeed] Fix newsfeed stall issue introduced by #3336 (#3361)
|
||||||
- Changed `log.debug` to `log.log` in `app.js` where logLevel is not set because config is not loaded at this time (#3353)
|
- Changed `log.debug` to `log.log` in `app.js` where logLevel is not set because config is not loaded at this time (#3353)
|
||||||
- added message in case where config.js is missing the module.export line PR #3383
|
- added message in case where config.js is missing the module.export line PR #3383
|
||||||
|
- Fixed an issue where recurring events could extend past their recurrence end date (#3393)
|
||||||
|
|
||||||
### Deleted
|
### Deleted
|
||||||
|
|
||||||
|
@ -311,6 +311,12 @@ const CalendarFetcherUtils = {
|
|||||||
arr[index] = new Date(date.valueOf() + oneDayInMs);
|
arr[index] = new Date(date.valueOf() + oneDayInMs);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// Adjusting the dates could push it beyond the 'until' date, so filter those out here.
|
||||||
|
if (rule.options.until !== null) {
|
||||||
|
dates = dates.filter((date) => {
|
||||||
|
return date.valueOf() <= rule.options.until.valueOf();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The dates array from rrule can be confused by DST. If the event was created during DST and we
|
// The dates array from rrule can be confused by DST. If the event was created during DST and we
|
||||||
|
30
tests/configs/modules/calendar/rrule_until.js
Normal file
30
tests/configs/modules/calendar/rrule_until.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
let config = {
|
||||||
|
timeFormat: 12,
|
||||||
|
|
||||||
|
modules: [
|
||||||
|
{
|
||||||
|
module: "calendar",
|
||||||
|
position: "bottom_bar",
|
||||||
|
config: {
|
||||||
|
hideDuplicates: false,
|
||||||
|
maximumEntries: 100,
|
||||||
|
calendars: [
|
||||||
|
{
|
||||||
|
maximumEntries: 100,
|
||||||
|
maximumNumberOfDays: 1, // Just today
|
||||||
|
url: "http://localhost:8080/tests/mocks/rrule_until.ics"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
Date.now = () => {
|
||||||
|
return new Date("07 Mar 2024 10:38:00 GMT-07:00").valueOf();
|
||||||
|
};
|
||||||
|
|
||||||
|
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||||
|
if (typeof module !== "undefined") {
|
||||||
|
module.exports = config;
|
||||||
|
}
|
@ -44,6 +44,22 @@ describe("Calendar module", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/****************************/
|
||||||
|
// RRULE TESTS:
|
||||||
|
// Add any tests that check rrule functionality here.
|
||||||
|
describe("rrule", () => {
|
||||||
|
it("Issue #3393 recurrence dates past rrule until date", async () => {
|
||||||
|
await helpers.startApplication("tests/configs/modules/calendar/rrule_until.js", "07 Mar 2024 10:38:00 GMT-07:00", ["js/electron.js"], "America/Los_Angeles");
|
||||||
|
expect(global.page).not.toBeNull();
|
||||||
|
const loc = await global.page.locator(".calendar .event");
|
||||||
|
const elem = loc.first();
|
||||||
|
await elem.waitFor();
|
||||||
|
expect(elem).not.toBeNull();
|
||||||
|
const cnt = await loc.count();
|
||||||
|
expect(cnt).toBe(1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
/****************************/
|
/****************************/
|
||||||
// LOS ANGELES TESTS:
|
// LOS ANGELES TESTS:
|
||||||
// In 2023, DST (GMT-7) was until 5 Nov, after which is standard (STD) (GMT-8) time.
|
// In 2023, DST (GMT-7) was until 5 Nov, after which is standard (STD) (GMT-8) time.
|
||||||
|
24
tests/mocks/rrule_until.ics
Normal file
24
tests/mocks/rrule_until.ics
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
BEGIN:VEVENT
|
||||||
|
DTSTART;TZID=America/Los_Angeles:20240229T160000
|
||||||
|
DTEND;TZID=America/Los_Angeles:20240229T190000
|
||||||
|
RRULE:FREQ=WEEKLY;WKST=MO;UNTIL=20240307T075959Z;BYDAY=TH
|
||||||
|
DTSTAMP:20240307T180618Z
|
||||||
|
CREATED:20231231T000501Z
|
||||||
|
LAST-MODIFIED:20231231T005623Z
|
||||||
|
SEQUENCE:2
|
||||||
|
STATUS:CONFIRMED
|
||||||
|
SUMMARY:My event
|
||||||
|
TRANSP:OPAQUE
|
||||||
|
END:VEVENT
|
||||||
|
BEGIN:VEVENT
|
||||||
|
DTSTART;TZID=America/Los_Angeles:20240307T160000
|
||||||
|
DTEND;TZID=America/Los_Angeles:20240307T190000
|
||||||
|
RRULE:FREQ=WEEKLY;WKST=MO;UNTIL=20240316T065959Z;BYDAY=TH
|
||||||
|
DTSTAMP:20240307T180618Z
|
||||||
|
CREATED:20231231T000501Z
|
||||||
|
LAST-MODIFIED:20231231T005623Z
|
||||||
|
SEQUENCE:3
|
||||||
|
STATUS:CONFIRMED
|
||||||
|
SUMMARY:My event
|
||||||
|
TRANSP:OPAQUE
|
||||||
|
END:VEVENT
|
Loading…
x
Reference in New Issue
Block a user