[Rt-commit] r18661 - in rt/3.999/trunk: . lib/RT
sartak at bestpractical.com
sartak at bestpractical.com
Wed Mar 4 16:21:53 EST 2009
Author: sartak
Date: Wed Mar 4 16:21:53 2009
New Revision: 18661
Modified:
rt/3.999/trunk/ (props changed)
rt/3.999/trunk/etc/RT_Config.pm
rt/3.999/trunk/lib/RT/Config.pm
rt/3.999/trunk/lib/RT/DateTime.pm
Log:
r80897 at onn: sartak | 2009-03-04 16:21:46 -0500
Turn DateTimeFormat into a string - a strftime format
Modified: rt/3.999/trunk/etc/RT_Config.pm
==============================================================================
--- rt/3.999/trunk/etc/RT_Config.pm (original)
+++ rt/3.999/trunk/etc/RT_Config.pm Wed Mar 4 16:21:53 2009
@@ -1280,18 +1280,19 @@
=item C<$DateTimeFormat>
-You can choose date and time format. See "Output formatters"
-section in perldoc F<lib/RT/Date.pm> for more options. This option can
-be overridden by users in their preferences.
+You can choose date and time format. This takes a L<DateTime/strftime> format
+specification. See L<DateTime/strftime_Patterns> for a full list of variables.
+
+This option can be overridden by users in their preferences.
+
Some examples:
-C<set($DateTimeFormat, { Format => 'ISO', Seconds => 0 });>
-C<set($DateTimeFormat, 'RFC2822');>
-C<set($DateTimeFormat, { Format => 'RFC2822', Seconds => 0, DayOfWeek => 0 });>
+C<set($DateTimeFormat, '%a, %d %b %Y %H:%M:%S %z');> # RFC2822
+C<set($DateTimeFormat, '%Y-%m-%d %H:%M:%S');> # ISO
=cut
-set($DateTimeFormat, 'DefaultFormat');
+set($DateTimeFormat, '%Y-%m-%d %H:%M:%S');
# Next two options are for Time::ParseDate
Modified: rt/3.999/trunk/lib/RT/Config.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Config.pm (original)
+++ rt/3.999/trunk/lib/RT/Config.pm Wed Mar 4 16:21:53 2009
@@ -278,16 +278,11 @@
DateTimeFormat => {
section => 'Locale', #loc
overridable => 1,
- widget => '/Widgets/Form/Select',
+ widget => '/Widgets/Form/String',
widget_arguments => {
- description => 'Date format', #loc
- values => [qw(default_format RFC2822 ISO W3CDTF)],
- values_label => {
- default_format => 'Tue Dec 25 21:59:12 1995', #loc
- RFC2822 => 'Tue, 25 Dec 1995 21:59:12 -0300', #loc
- ISO => '1995-11-25 21:59:12', #loc
- W3CDTF => '1995-11-25T21:59:12Z', #loc
- },
+ description => 'Date format', #loc
+ hints =>
+"Use a strftime format string" #loc
},
},
EmailFrequency => {
Modified: rt/3.999/trunk/lib/RT/DateTime.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/DateTime.pm (original)
+++ rt/3.999/trunk/lib/RT/DateTime.pm Wed Mar 4 16:21:53 2009
@@ -12,7 +12,7 @@
my $self = shift;
return "unset" if $self->epoch == 0;
- return $self->iso;
+ return $self->strftime(RT->config->get('DateTimeFormat'));
}
sub age {
More information about the Rt-commit
mailing list