Grilled Cheese

ExploreLog inSign up
Terms of UsePrivacy PolicyCommunity StandardsHelpGet the app

Grilled Cheese is a product of Village Compute

Version devBuilt at: 2026-12-03 22:42:33 EST

PhotosVideosAllPeople
LatestRanked
Photo, no description
Photo, no description
Photo, no description
Photo, no description
JavaScript code in time-ago.js. const formatter = new Intl.RelativeTimeFormat('en', { numeric: 'auto' }). const UNITS = new Map([['year', 31_536_000], ['month', 2_592_000], ['day', 86_400], ['hour', 3_600], ['minute', 60], ['second', 1]]). function timeAgo(date) { const seconds = (date - Date.now()) / 1000; for (const [unit, size] of UNITS) { if (Math.abs(seconds) >= size || unit === 'second') { return formatter.format(Math.round(seconds / size), unit); } } }. Then: timeAgo(new Date()) gives "now", timeAgo(new Date(Date.now() - 86_400_000)) gives "yesterday", timeAgo(new Date(Date.now() + 3 * 86_400_000)) gives "in 3 days". The formatter line and the return line are highlighted.