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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.