Added missing context to interpolation subfunctions.

This commit is contained in:
DebaucheryLibrarian 2024-10-22 02:21:15 +02:00
parent 1be31a9066
commit 149c83f34b
1 changed files with 5 additions and 5 deletions

View File

@ -21,16 +21,16 @@ function getMostFrequent(items, { slugify }) {
return mostFrequent; return mostFrequent;
} }
function getMostFrequentDate(dates, { moment }) { function getMostFrequentDate(dates, context) {
const year = getMostFrequent(dates.map((dateX) => dateX.getFullYear())); const year = getMostFrequent(dates.map((dateX) => dateX.getFullYear()), context);
const month = getMostFrequent(dates.map((dateX) => dateX.getMonth())); const month = getMostFrequent(dates.map((dateX) => dateX.getMonth()), context);
const date = getMostFrequent(dates.map((dateX) => dateX.getDate())); const date = getMostFrequent(dates.map((dateX) => dateX.getDate()), context);
if (year === null || month === null || date === null) { if (year === null || month === null || date === null) {
return null; return null;
} }
return moment({ year, month, date }).toDate(); return context.moment({ year, month, date }).toDate();
} }
function getHighest(items) { function getHighest(items) {