[
https://issues.apache.org/jira/browse/JSPWIKI-244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Florian Holeczek closed JSPWIKI-244.
------------------------------------
> Rendering Date and Time from Plugins
> ------------------------------------
>
> Key: JSPWIKI-244
> URL: https://issues.apache.org/jira/browse/JSPWIKI-244
> Project: JSPWiki
> Issue Type: Improvement
> Components: Localization
> Affects Versions: 2.6.2
> Environment: Any
> Reporter: Goran Karlic
> Assignee: Janne Jalkanen
> Priority: Trivial
> Fix For: 2.8
>
>
> This issue originated from JSPWIKI-196
> [~brushed] proposal for rendering time/dates:
> All template JSPs are currently using JSTL for date formatting. For example:
> {code:xml}
> <fmt:formatDate value="<%= firstPage.getLastModified() %>"
> pattern="${prefs['DateFormat']}" />
> {code}
> This formats the date according to the preferred date-format (the default is
> read from jspwiki.properties) and according to the default locale, which
> typically is taken from the user's browser.
> However, several plugins and tags (RecentChangesPlugin, CurrentTimePlugin,
> WebLogPlugin, ...) are using there own cooking to format dates.
> To resolve this, I would recommend to introduce a helper function to format
> dates consistently, which uses the selected preferences and default browser
> settings.
> So you can use from plugin code :
> {code}
> SimpleDateFormat fmt = Preferences.getDateFormat( pagecontext );
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira