Hi,
We have a custom user macro that is no longer working and we are not able to fix the code.
This user macro compute dates based on current date
Here is the code:
## Macro title: Relative Date
## Macro has a body: No
## Body processing: No macro body
##
## This user macro compute date base on current date and the parameters
## @Param type:title=Type|type=enum|required=true|enumValues=Day,Week,Month,Year
## @Param increment:title=Increment|type=int|required=true|desc= Increment value
## @Param rounded:title=Round|type=enum|required=false|enumValues=Up,Down
## declare variables and initialize as java date objects with current date
#set ($newDate = $action.dateFormatter.calendar)
#set($increment = $generalUtil.convertToInteger("$paramincrement"))
$newDate.setTime($content.currentDate)
## https://docs.oracle.com/javase/7/docs/api/constant-values.html#java.util.Calendar.WEEK_OF_MONTH
##Year
#if( $paramtype == "Year" )
$newDate.add(1, $increment)
#if( $paramrounded == "Up")
$newDate.set(6, $newDate.getActualMaximum(6))
#elseif( $paramrounded == "Down" )
$newDate.set(6, 1)
#end
##Month
#elseif( $paramtype == "Month" )
$newDate.add(2, $increment)
#if( $paramrounded == "Up")
$newDate.set(5, $newDate.getActualMaximum(5))
#elseif( $paramrounded == "Down" )
$newDate.set(5, 1)
#end
##Week
#elseif( $paramtype == "Week" )
$newDate.add(4, $increment)
#if( $paramrounded == "Up")
$newDate.set(7, $newDate.getActualMaximum(7))
#elseif( $paramrounded == "Down" )
$newDate.set(7, 1)
#end
##Day
#elseif( $paramtype == "Day" )
$newDate.add(6, $increment)
#end
<time datetime="$action.dateFormatter.formatGivenString("yyyy-MM-dd", $newDate.time)" class="date-upcoming">$action.dateFormatter.formatGivenString("dd MMM yyyy", $newDate.time)</time>
The type of error messages we see in Confluence now wherever the macro is used:
$newDate.setTime($content.currentDate) $newDate.add(2, $increment) $newDate.set(5, $newDate.getActualMaximum(5)) 
Anyone as an idea what is wrong in the code? It used to work fine until just recently...
Thanks!