You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by bu...@apache.org on 2003/10/06 17:36:05 UTC

DO NOT REPLY [Bug 23622] New: - Locale sensitive printing of dates and time

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23622>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23622

Locale sensitive printing of dates and time

           Summary: Locale sensitive printing of dates and time
           Product: Velocity
           Version: 1.0-Release
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Tools
        AssignedTo: velocity-dev@jakarta.apache.org
        ReportedBy: pbv@cutehoor.com


No way (that I could find) to print dates and times in a Locale sensitive way.
In other words, US users see 12/31/03 and others see 31/12/03, and for month
names the correct language should be displayed. Similarly 12 or 24 hour time
formats differ around the world.

I've got a patch that adds some simple DateFormat stuff to the DateTool to get
an appropriate instance, and print using Locale and TimeZone. Very loosly
modelled on the Cocoon formatter, passing in "short", "medium", "long" or "full".

Example usage from my app, where I've got a user bean in scope that stores an
appropriate Locale and TimeZone for each user.
$date.formatDate('medium',$lastReadTime,$user.locale,$user.timeZone)

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org