[Rt-devel] $DateDayBeforeMonth in DefaultFormat and enhance of date/time display

Jesse Vincent jesse at bestpractical.com
Fri Jan 9 12:23:15 EST 2009




On Fri  9.Jan'09 at 15:13:11 +0100, Emmanuel Lacour wrote:
> 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.

Hm.  This makes me a little twitchy. I'd really rather keep it
parsing-only. I like your suggestion below :)


> 
> But maybe we would better make use of DateTime::Locale for displaying
> date/times to be sure to cover most languages.

I like this plan better :)

> Here is an example of DateTime::Locale usage (as I understand this
> module):
>

Cool. Can we make it depend on DateTime::Locale only if it's installed?

Also, I'd probably only offer the datetime formats, since only-date and
only-time formats don't make a whole lot of sense in RT ;)
 
> 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
> 
> 


> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://lists.bestpractical.com/pipermail/rt-devel/attachments/20090109/b1667a28/attachment.pgp 


More information about the Rt-devel mailing list