mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-09-13 23:55:11 +00:00
Refactor calendar methods into util class (#3088)
Refactored some methods in calendar module: - move methods into own file - dont call shorten method from titelTransform because why? just call them after each other. - added tests for util methods - cleaned up other tests --------- Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
@@ -11,7 +11,7 @@ const ical = require("node-ical");
|
||||
const fetch = require("fetch");
|
||||
const Log = require("logger");
|
||||
const NodeHelper = require("node_helper");
|
||||
const CalendarUtils = require("./calendarutils");
|
||||
const CalendarFetcherUtils = require("./calendarfetcherutils");
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -72,7 +72,7 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn
|
||||
try {
|
||||
data = ical.parseICS(responseData);
|
||||
Log.debug(`parsed data=${JSON.stringify(data)}`);
|
||||
events = CalendarUtils.filterEvents(data, {
|
||||
events = CalendarFetcherUtils.filterEvents(data, {
|
||||
excludedEvents,
|
||||
includePastEvents,
|
||||
maximumEntries,
|
||||
|
Reference in New Issue
Block a user