4 use RT::Test tests => undef;
6 my $root = RT::CurrentUser->new('root');
7 my ($ok, $msg) = $root->UserObj->SetLang('en-us');
10 my $year = (localtime time)[5] + 1900;
11 my $date = RT::Date->new( $root );
14 like $date->AsString( Format => 'LocalizedDateTime' ),
15 qr/\Q$year\E/, 'contains full year';
17 unlike $date->AsString( Format => 'LocalizedDateTime', DateFormat => 'date_format_short' ),
18 qr/\Q$year\E/, 'lacks full year';
21 $date->AsString( Format => 'LocalizedDateTime', DateFormat => 'bogus::format' );
23 ok !$@, "didn't die with bogus DateFormat";
26 $date->AsString( Format => 'LocalizedDateTime', TimeFormat => 'bogus::format' );
28 ok !$@, "didn't die with bogus TimeFormat";