My goal is to dynamically change a message based on how close a specific date is. The objective is to update an element of a webpage to display "Renewal Unnecessary" when the date is more than 3 months away, "Renewal upcoming" when the date is less than 3 months away, and finally "Renewal Required!" when the date is just 1 month away. As of now, my code snippet looks like this:
if()
{<hre>Renewal Required!</hre>}
else if()
{<ha>Renewal upcoming</ha>}
else
{<hg>Renewal Unnecessary</hg>}
I am struggling with determining the condition for this script to execute properly. For instance, the renewal date might be set for February 26th - is there a way to synchronize it with the computer's current date?