[Rt-devel] $DateDayBeforeMonth in DefaultFormat and enhance of date/time display
Emmanuel Lacour
elacour at easter-eggs.com
Fri Jan 9 09:13:11 EST 2009
Dear RT hackers,
current display of date in RT is not correct for french speakers at
least, because mday is before month in Date::DefaultFormat.
so I think it would be good to use $DateDayBeforeMonth here like the
attached patch.
But maybe we would better make use of DateTime::Locale for displaying
date/times to be sure to cover most languages.
Here is an example of DateTime::Locale usage (as I understand this
module):
use DateTime;
use DateTime::Locale;
my $loc = DateTime::Locale->load('fr');
my $format = 'full_date_format';
my $dt = DateTime->from_epoch( locale => 'fr',
epoch => time,
time_zone => 'Europe/Paris',
);
print $dt->strftime($loc->$format);
Output: vendredi 9 janvier 2009
We can still present the different format available in user preferences
and in global config:
full_date_format: vendredi 9 janvier 2009
long_date_format: 9 janvier 2009
medium_date_format: 9 jan 2009
short_date_format: 09/01/09
full_time_format: 12:55:57 v
long_time_format: 12:55:57 Europe/Paris
medium_time_format: 12:55:57
short_time_format: 12:55
full_datetime_format: vendredi 9 janvier 2009 12:55:57 v
long_datetime_format: 9 janvier 2009 12:55:57 Europe/Paris
medium_datetime_format: 9 jan 2009 12:55:57
short_datetime_format: 09/01/09 12:55
-------------- next part --------------
A non-text attachment was scrubbed...
Name: date_day_before_month.patch
Type: text/x-diff
Size: 928 bytes
Desc: not available
Url : http://lists.bestpractical.com/pipermail/rt-devel/attachments/20090109/4c634d3c/attachment.patch
More information about the Rt-devel
mailing list