We can simplify the proposition of Esteban Filardi with this code :
const oldDate = new Date('July 21, 2001 01:15:23'); const todayDate = new Date(); const oneYear = 1000 * 60 * 60 * 24 * 365; isPastOneYear = todayDate - oldDate > oneYear;