I want to make a macro that looks at an input date and if that date is in the past, I want to replace it with the current date. Here is what I'm looking at:
## @param inputDate:title=From Date|type=date|desc=Date to start from. Format: MM/dd/yy
#set ($currentDate=$action.dateFormatter.formatGivenString("MM/dd/yy", $content.currentDate))
#if ($paraminputDate.before($current_time))
$currentDate
#else
$paraminputDate
#endCurrently I'm only getting the else. So I'm assuming that I'm using the .before incorrectly. Any help would be appreciated. Thanks.
Edit: I got it working. Here is the code. I am using it for dynamic charts that display schedules.
## @param inputDate:title=From Date|type=date|desc=Date to start from. Format: MM/dd/yy
#set($inputDate=$content.currentDate)
$inputDate.setTime($content.currentDate.parse($paraminputDate))
#if ($inputDate.before($content.currentDate))
$action.dateFormatter.formatGivenString("MM/dd/yy", $content.currentDate)
#else
$paraminputDate
#end