feat: a whole bunch of fixes ahead of launch

This commit is contained in:
Devin Haska 2024-03-03 00:27:54 -08:00
parent 01647bf930
commit 8e54b46b6b
48 changed files with 184 additions and 140 deletions

View file

@ -83,6 +83,15 @@ const filterFavourites = (collection) => {
return collection.filter((item) => item.data.favourite);
};
const isOld = (dateArg) => {
const date = dayjs(dateArg);
const now = dayjs();
const diffInYears = now.diff(date, "years");
return diffInYears >= 2;
};
module.exports = {
allTagCounts,
allTags,
@ -91,6 +100,7 @@ module.exports = {
filterCatalogueTags,
filterFavourites,
formatDate,
isOld,
keys,
limit,
organizeByDate,