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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user