Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×How can I get a current year in ./confluence/decorators/includes/footer-content.vm? I can get a date string by $action.getDateFormatter().getCurrentDate() but want to use the DataFormatter to format for just year but it takes Date objects and I seem to lack one.
I want to put copyright my-corp $year in the footer.
Thanks
Hey Peter,
For a list of all the parameters available in the context refer to https://developer.atlassian.com/confdev/development-resources/confluence-architecture/confluence-internals/velocity-template-overview/confluence-objects-accessible-from-velocity
Try getCalendar() using DateFormatter and getting the YEAR attribute.
$dateFormatter.getCalendar().getInstance().get(Calendar.YEAR)
So this sort of works but I feel like I should bet able to get year without a hard coded value #set ($calendar = $action.getDateFormatter().getCalendar()) <p style="text-align:center"> Copyright © 2008 - $calendar.get(1)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.