Skip to content

Instantly share code, notes, and snippets.

@madeingnecca
Last active March 11, 2016 10:01
Show Gist options
  • Save madeingnecca/9f7bcabc00dd2b1d91e7 to your computer and use it in GitHub Desktop.
Save madeingnecca/9f7bcabc00dd2b1d91e7 to your computer and use it in GitHub Desktop.
LIFERAY VELOCITY utils
## Print article date with a localized format.
##############################################
#set ($localeDefault = $localeUtil.getDefault())
## Convert string (with a particular input format) to a Date object.
#set ($modifiedDate = $dateTool.toDate("EEE, dd MMM yyyy hh:mm:ss Z", $reserved-article-display-date.getData(), $localeDefault))
## Get the localized format as a string.
#set ($dateFormat = "#language ('custom-medium-dateformat-pattern')")
$dateTool.format($dateFormat, $modifiedDate)
# Get current site name.
########################
#set ($site_name = $themeDisplay.getLayout().getGroup().getName())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment