You might want to look at moment.js if your working with date differences. The library makes this really easy. Just get the diff then check if it’s greater than your max date, if it’s less great if not let the user know.