Summary
One of the customer is reporting an issue related to week number being wrong when implementing a user macro.
Steps to Reproduce
- Create an user macro with the following content:
## Macro title: My Macro
## Macro has a body: Y or N
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: My Name
## Date created: dd/mm/yyyy
## Installed by: My Name
## This is an example macro
## @param Name:title=Name|type=string|required=true|desc=Your name
## @param Colour:title=Favourite Colour|type=enum|enumValues=red,green,blue|default=red|desc=Choose your favourite colour
#set($calendar = $action.dateFormatter.calendar)
#set($week= $calendar.get(3)) #* 3rd field of constants = WEEK_OF_YEAR *#
$week
$calendar
- Embed the newly created macro on a Confluence page
Expected results
The correct week number is displayed, for example on March 14th, 2016 it should be 11.
Actual results
The week number displayed is higher than the expected, for March 14th, 2016 it displays 12.
The above is caused by the minimalDaysInFirstWeek setting derived is set to 1 instead of 4, which makes the first truncated week to be counted.
Workaround
Updating JAVA_OPTS (Confluence 5.5 and earlier or CATALINA_OPTS 5.6 or later) variable in <confluence-install>/bin/setenv.sh with adding the following options: -Duser.language=en -Duser.country=GB -Duser.variant=GB .