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) {