JSFiddle - React, Tailwind, and code Playground
JavaScript
var now = new Date();
var anotherNow = new Date();
var past = new Date(1975,0,0,0,0,0,0,0);
var future = new Date(now.getFullYear()+1,0,0,0,0,0,0);
console.log( 'past < now: ' + (past < now) );
console.log( 'past <= now: ' + (past <= now) );
console.log( 'now < future: ' + (now < future) );
console.log( 'now >= future: ' + (now >= future) );
console.log( 'now >= anotherNow && now <= anotherNow: ' + (now >= anotherNow && now <= anotherNow) );