Hi,
I need to compare an entered date with the current date.
Also this topic came up several times in the forum, I could not find a proper solution. My current coding looks like this:
x = new Date();
currDate = parseFloat((x.getYear()+1900).toString() + (x.getMonth()+1).toString()+(x.getDate()).toString());
enteredDate = parseFloat((this.rawValue).replace(/-/g,""));
if (currDate < enteredDate)
{
xfa.host.messageBox ("Invalid date! Please enter a date before the current date");
this.rawValue = "";
}
But in order to compare the dates, I still need to format the month in MM, if the entered month is below 10 (Same for day). How can I change the formatting from e.g. "5" to "05"?