From 149c83f34b36a85c54d01dbef5e88492aec39b6f Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Tue, 22 Oct 2024 02:21:15 +0200 Subject: [PATCH] Added missing context to interpolation subfunctions. --- src/actors.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/actors.js b/src/actors.js index 4e3ed4a..0075962 100644 --- a/src/actors.js +++ b/src/actors.js @@ -21,16 +21,16 @@ function getMostFrequent(items, { slugify }) { return mostFrequent; } -function getMostFrequentDate(dates, { moment }) { - const year = getMostFrequent(dates.map((dateX) => dateX.getFullYear())); - const month = getMostFrequent(dates.map((dateX) => dateX.getMonth())); - const date = getMostFrequent(dates.map((dateX) => dateX.getDate())); +function getMostFrequentDate(dates, context) { + const year = getMostFrequent(dates.map((dateX) => dateX.getFullYear()), context); + const month = getMostFrequent(dates.map((dateX) => dateX.getMonth()), context); + const date = getMostFrequent(dates.map((dateX) => dateX.getDate()), context); if (year === null || month === null || date === null) { return null; } - return moment({ year, month, date }).toDate(); + return context.moment({ year, month, date }).toDate(); } function getHighest(items) {