Better fixes for #3291 and the underlying exdate issues (#3342)

* 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:
jkriegshauser
2024-01-26 22:56:54 -08:00
committed by GitHub
parent 27f3c86c41
commit 7f0b8e4054
20 changed files with 528 additions and 219 deletions

View File

@@ -3,11 +3,11 @@
// https://www.anycodings.com/1questions/958135/can-i-set-the-date-for-playwright-browser
const { _electron: electron } = require("playwright");
exports.startApplication = async (configFilename, systemDate = null, electronParams = ["js/electron.js"]) => {
exports.startApplication = async (configFilename, systemDate = null, electronParams = ["js/electron.js"], timezone = "GMT") => {
global.electronApp = null;
global.page = null;
process.env.MM_CONFIG_FILE = configFilename;
process.env.TZ = "GMT";
process.env.TZ = timezone;
global.electronApp = await electron.launch({ args: electronParams });
await global.electronApp.firstWindow();
@@ -20,7 +20,7 @@ exports.startApplication = async (configFilename, systemDate = null, electronPar
if (systemDate) {
await global.page.evaluate((systemDate) => {
Date.now = () => {
return new Date(systemDate);
return new Date(systemDate).valueOf();
};
}, systemDate);
}