[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.6-216-ga709560
Shawn Moore
sartak at bestpractical.com
Mon Nov 29 13:55:10 EST 2010
The branch, 3.9-trunk has been updated
via a7095603933f97666729bb8dd3bbf0495c8f17fd (commit)
from cc9cbab51b9c541295baa33d0066581dce64754b (commit)
Summary of changes:
lib/RT/Date.pm | 24 +++++++-----------------
sbin/rt-test-dependencies.in | 2 ++
t/api/date.t | 31 ++++++++-----------------------
3 files changed, 17 insertions(+), 40 deletions(-)
- Log -----------------------------------------------------------------
commit a7095603933f97666729bb8dd3bbf0495c8f17fd
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Mon Nov 29 13:54:23 2010 -0500
Bring up DateTime and DateTime::Locale to real deps
diff --git a/lib/RT/Date.pm b/lib/RT/Date.pm
index c22a362..f507ebc 100755
--- a/lib/RT/Date.pm
+++ b/lib/RT/Date.pm
@@ -112,16 +112,14 @@ our @DAYS_OF_WEEK = (
);
our @FORMATTERS = (
- 'DefaultFormat', # loc
- 'ISO', # loc
- 'W3CDTF', # loc
- 'RFC2822', # loc
- 'RFC2616', # loc
- 'iCal', # loc
+ 'DefaultFormat', # loc
+ 'ISO', # loc
+ 'W3CDTF', # loc
+ 'RFC2822', # loc
+ 'RFC2616', # loc
+ 'iCal', # loc
+ 'LocalizedDateTime', # loc
);
-if (DateTime->can('format_cldr') && DateTime::Locale::root->can('date_format_full') ) {
- push @FORMATTERS, 'LocalizedDateTime'; # loc
-}
=head2 new
@@ -636,8 +634,6 @@ time format as specified in DateTime::Locale (default to full_date_format and
medium_time_format), C<AbbrDay> and C<AbbrMonth> which may be set to 0 if
you want full Day/Month names instead of abbreviated ones.
-Require optionnal DateTime::Locale module.
-
=cut
sub LocalizedDateTime
@@ -653,10 +649,6 @@ sub LocalizedDateTime
@_,
);
- return $self->loc("DateTime doesn't support format_cldr, you must upgrade to use this feature")
- unless DateTime::->can('format_cldr');
-
-
my $date_format = $args{'DateFormat'};
my $time_format = $args{'TimeFormat'};
@@ -668,8 +660,6 @@ sub LocalizedDateTime
my $formatter = DateTime::Locale->load($lang);
- return $self->loc("DateTime::Locale doesn't support date_format_full, you must upgrade to use this feature")
- unless $formatter->can('date_format_full');
$date_format = $formatter->$date_format;
$time_format = $formatter->$time_format;
$date_format =~ s/EEEE/EEE/g if ( $args{'AbbrDay'} );
diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index 35ebebe..f9aae9d 100755
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -171,6 +171,8 @@ sub text_to_hash {
}
$deps{'CORE'} = [ text_to_hash( << '.') ];
+DateTime 0.44
+DateTime::Format 0.40
Digest::base
Digest::MD5 2.27
DBI 1.37
diff --git a/t/api/date.t b/t/api/date.t
index 1e23e18..476c22d 100644
--- a/t/api/date.t
+++ b/t/api/date.t
@@ -3,23 +3,8 @@
use Test::MockTime qw(set_fixed_time restore_time);
use DateTime;
-use Test::More;
-my $tests;
-
-my $localized_datetime_tests;
-BEGIN {
- $tests = 165;
- $localized_datetime_tests = DateTime->can('format_cldr') && DateTime::Locale::root->can('date_format_full');
-
- if ($localized_datetime_tests) {
-
- # Include RT::Date::LocalizedDateTime tests
- $tests += 7;
- }
-}
-
use warnings; use strict;
-use RT::Test tests => $tests;
+use RT::Test tests => 172;
use RT::User;
use Test::Warn;
@@ -111,7 +96,7 @@ my $current_user;
"RFC2822 format with defaults");
is($date->Get(Format =>'LocalizedDateTime'),
'Thu, Jan 1, 1970 12:00:00 AM',
- "LocalizedDateTime format with defaults") if ( $localized_datetime_tests );
+ "LocalizedDateTime format with defaults");
is($date->ISO(Time => 0),
'1970-01-01',
@@ -124,7 +109,7 @@ my $current_user;
"RFC2822 format without time part");
is($date->LocalizedDateTime(Time => 0),
'Thu, Jan 1, 1970',
- "LocalizedDateTime format without time part") if ( $localized_datetime_tests );
+ "LocalizedDateTime format without time part");
is($date->ISO(Date => 0),
'00:00:00',
@@ -137,7 +122,7 @@ my $current_user;
"RFC2822 format without date part");
is($date->LocalizedDateTime(Date => 0),
'12:00:00 AM',
- "LocalizedDateTime format without date part") if ( $localized_datetime_tests );
+ "LocalizedDateTime format without date part");
is($date->ISO(Date => 0, Seconds => 0),
'00:00',
@@ -158,16 +143,16 @@ my $current_user;
is($date->LocalizedDateTime(AbbrDay => 0),
'Thursday, Jan 1, 1970 12:00:00 AM',
- "LocalizedDateTime format without abbreviation of day") if ( $localized_datetime_tests );
+ "LocalizedDateTime format without abbreviation of day");
is($date->LocalizedDateTime(AbbrMonth => 0),
'Thu, January 1, 1970 12:00:00 AM',
- "LocalizedDateTime format without abbreviation of month") if ( $localized_datetime_tests );
+ "LocalizedDateTime format without abbreviation of month");
is($date->LocalizedDateTime(DateFormat => 'date_format_short'),
'1/1/70 12:00:00 AM',
- "LocalizedDateTime format with non default DateFormat") if ( $localized_datetime_tests );
+ "LocalizedDateTime format with non default DateFormat");
is($date->LocalizedDateTime(TimeFormat => 'time_format_short'),
'Thu, Jan 1, 1970 12:00 AM',
- "LocalizedDateTime format with non default TimeFormat") if ( $localized_datetime_tests );
+ "LocalizedDateTime format with non default TimeFormat");
is($date->Date,
'1970-01-01',
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list