Uploaded image for project: 'JSPWiki'
  1. JSPWiki
  2. JSPWIKI-244

Rendering Date and Time from Plugins

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 2.6.2
    • 2.8
    • Localization
    • None
    • Any

    Description

      This issue originated from JSPWIKI-196

      brushed proposal for rendering time/dates:

      All template JSPs are currently using JSTL for date formatting. For example:

      <fmt:formatDate value="<%= firstPage.getLastModified() %>" pattern="${prefs['DateFormat']}" />
      

      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 :

      SimpleDateFormat fmt = Preferences.getDateFormat( pagecontext );
      

      Attachments

        Issue Links

          Activity

            People

              jalkanen Janne Jalkanen
              gkarlic Goran Karlic
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: