incubator-jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dirk Frederickx (JIRA)" <>
Subject [jira] Commented: (JSPWIKI-196) Date and time format accoding to ISO 8601
Date Sat, 23 Feb 2008 15:09:19 GMT


Dirk Frederickx commented on JSPWIKI-196:

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
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 );


This still doesn't resolve the issue of writing dates onto the page contents. The proposed
ISO8601 format seems like a good choice, but indeed not very user-friendly. 

So, why not wrap this (automatic generated) page-content dates into a jspwiki plugin ? Like

Lorem ipsum dolor sit amet, [{DATE value='20080229' }]  consectetuer adipiscing elit. 


The DATE plugin would make sure the date gets rendered according to preferences / browsers


> Date and time format accoding to ISO 8601
> -----------------------------------------
>                 Key: JSPWIKI-196
>                 URL:
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Localization
>    Affects Versions: 2.6.1
>         Environment: Any
>            Reporter: Goran Karlic
>            Priority: Trivial
> We have multiple occurences of hard-coded or context-unaware DateTime to String conversions
(page properties, JSPs, templates).
> My proposal is to rely on an international standard instead of using an invented default.
The current international standard is ISO 8601 (s. Wikipedia). My further proposal is to show
time with the precision to the second, as the SI unit system defines the second as the basic
unit of time. Furthermore "GMT" is replaced by "UTC" and they might differ up to a second
(s. Wikipedia).
> I think this will make unlocalized strings more transparent to the users and easier to
decode correctly (consider 02/03/08 - is it in the future or in the past - or might it even
be the current time?!).
> Following this proposal java format strings allowed for above cases would be: 
> (1) Simple date: "yyyy-MM-dd" ("The daily mail for 2008-02-20 was sent")
> (2) Date and time
> (2.1) Explicit time context: "yyyy-MM-dd hh:mm:ssZ" ("User gkarlic made this at 2008-02-20
> (2.2) Implicit time context: "yyyy-MM-dd hh:mm:ss" ("This server lives on CET, here it
is 2008-02-20 22:38:10")
> Where (2.1) would be used for strings that might emerge from different time-zones.
> If others agree with this proposal, I would gladly make the required changes.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message