add webgui to strftime conversion sub
This commit is contained in:
parent
a751c3a48d
commit
731ae3801a
2 changed files with 73 additions and 45 deletions
12
t/DateTime.t
12
t/DateTime.t
|
|
@ -26,7 +26,7 @@ my $session = WebGUI::Test->session;
|
|||
|
||||
# put your tests here
|
||||
|
||||
plan tests => 28;
|
||||
plan tests => 30;
|
||||
|
||||
my $timeZoneUser = addUser($session);
|
||||
|
||||
|
|
@ -91,6 +91,16 @@ ok($@, 'new croaks on an out of range time');
|
|||
my $badday = eval { WebGUI::DateTime->new($session, '2001-08-16 99:199:99'); };
|
||||
ok($@, 'new croaks on an illegal time');
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Test webguiToStrftime conversion
|
||||
is( $nowDt->webguiToStrftime('%y-%m-%d'), '%Y-%m-%d', 'webgui to strftime conversion' );
|
||||
|
||||
$timeZoneUser->update({ 'dateFormat' => '%y-%M-%D' });
|
||||
$timeZoneUser->update({ 'timeFormat' => '%H:%n %p' });
|
||||
is( $nowDt->webguiToStrftime, '%Y-%_varmonth_-%e %l:%M %P', 'default datetime string' );
|
||||
|
||||
|
||||
sub addUser {
|
||||
my $session = shift;
|
||||
my $user = WebGUI::User->new($session, "new");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue