[Rt-commit] r17705 - rt/3.8/trunk/lib/RT
elacour at bestpractical.com
elacour at bestpractical.com
Mon Jan 12 03:58:59 EST 2009
Author: elacour
Date: Mon Jan 12 03:58:59 2009
New Revision: 17705
Modified:
rt/3.8/trunk/lib/RT/Config.pm
Log:
Dynamically localize each DateTime preferences so we are sure to present the
correct string to user preferences.
Modified: rt/3.8/trunk/lib/RT/Config.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Config.pm (original)
+++ rt/3.8/trunk/lib/RT/Config.pm Mon Jan 12 03:58:59 2009
@@ -272,12 +272,14 @@
Widget => '/Widgets/Form/Select',
WidgetArguments => {
Description => 'Date format', #loc
- Values => [qw(DefaultFormat RFC2822 ISO W3CDTF)],
- ValuesLabel => {
- DefaultFormat => 'Tue Dec 25 21:59:12 1995', #loc_left_pair
- RFC2822 => 'Tue, 25 Dec 1995 21:59:12 -0300', #loc_left_pair
- ISO => '1995-11-25 21:59:12', #loc_left_pair
- W3CDTF => '1995-11-25T21:59:12Z', #loc_left_pair
+ Callback => sub { my $ret = { Values => [], ValuesLabel => {}};
+ my $date = new RT::Date($HTML::Mason::Commands::session{'CurrentUser'});
+ $date->Set;
+ foreach my $value (qw(DefaultFormat RFC2822 ISO W3CDTF)) { #loc_qw
+ push @{$ret->{Values}}, $value;
+ $ret->{ValuesLabel}{$value} = $date->$value();
+ }
+ return $ret;
},
},
},
More information about the Rt-commit
mailing list