Add a badge on locations for new photos

- The last updated date is taken from the latest photo of each location (without any other API call, just some data manipulation)
- Manipulation of data in the preload request instead of the code
This commit is contained in:
2020-05-06 17:12:07 +02:00
parent 3230cfa0d0
commit cd609cd710
8 changed files with 132 additions and 44 deletions

View File

@@ -185,6 +185,16 @@ export const relativeTime = (originDate, limit = 0) => {
}
/*
** Check if date is older than
*/
export const dateOlderThan = (originDate, limit) => {
const date = new Date(originDate)
const diff = Number(new Date()) - date
return diff < limit
}
/*
** Controls Anime.js parallax
*/