Added missing context to interpolation subfunctions.
This commit is contained in:
parent
1be31a9066
commit
149c83f34b
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue