Variable hour formats don't add an extra space any longer. Fixes bug #11915.
This commit is contained in:
parent
dac8186244
commit
19a87ea003
5 changed files with 20 additions and 9 deletions
|
|
@ -130,7 +130,7 @@ is(
|
|||
);
|
||||
|
||||
$date2 = WebGUI::Form::DateTime->new($session, {defaultValue => -1});
|
||||
is($date2->getValueAsHtml(), '12/31/1969 5:59 pm', "getValueAsHtml: defaultValue as negative epoch, returns as user's format");
|
||||
is($date2->getValueAsHtml(), '12/31/1969 5:59 pm', "getValueAsHtml: defaultValue as negative epoch, returns as user's format");
|
||||
is(
|
||||
getValueFromForm($session, $date2->toHtmlAsHidden),
|
||||
'1969-12-31 17:59:59',
|
||||
|
|
@ -158,7 +158,7 @@ is(
|
|||
|
||||
|
||||
$date2 = WebGUI::Form::DateTime->new($session, {defaultValue => '2008-08-01 11:34:26', value => $bday, });
|
||||
is($date2->getValueAsHtml(), '8/16/2001 8:00 am', "getValueAsHtml: defaultValue in mysql format, value as epoch returns value in user's format");
|
||||
is($date2->getValueAsHtml(), '8/16/2001 8:00 am', "getValueAsHtml: defaultValue in mysql format, value as epoch returns value in user's format");
|
||||
is(
|
||||
getValueFromForm($session, $date2->toHtmlAsHidden),
|
||||
'2001-08-16 08:00:00',
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ my @testSets = (
|
|||
},
|
||||
{
|
||||
format => '',
|
||||
output =>'8/16/2001 8:00 am',
|
||||
output =>'8/16/2001 8:00 am',
|
||||
},
|
||||
);
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ is($output, $session->datetime->epochToHuman($time1), 'checking default time and
|
|||
|
||||
##Checking for edge case, time=0
|
||||
is WebGUI::Macro::D_date::process($session, '', 0),
|
||||
'12/31/1969 6:00 pm',
|
||||
'12/31/1969 6:00 pm',
|
||||
'...checking for handling time=0';
|
||||
|
||||
lives_ok { WebGUI::Macro::D_date::process($session, '', ' 0') }
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use File::Spec;
|
|||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
|
||||
use Test::More tests => 92; # increment this value for each test you create
|
||||
use Test::More tests => 95; # increment this value for each test you create
|
||||
|
||||
installBadLocale();
|
||||
WebGUI::Test->addToCleanup(sub { unlink File::Spec->catfile(WebGUI::Test->lib, qw/WebGUI i18n BadLocale.pm/); });
|
||||
|
|
@ -298,9 +298,15 @@ cmp_ok(
|
|||
|
||||
$dude->profileField('language', 'BadLocale');
|
||||
$session->user({user => $dude});
|
||||
is($dt->epochToHuman($wgbday), '8/16/2001 9:00 pm', 'epochToHuman: constructs a default locale if the language does not provide one.');
|
||||
is($dt->epochToHuman($wgbday), '8/16/2001 9:00 pm', 'epochToHuman: constructs a default locale if the language does not provide one.');
|
||||
$session->user({userId => 1});
|
||||
|
||||
##Variable digit days, months and hours
|
||||
is($dt->epochToHuman($wgbday,'%M'), '8', '... single digit month');
|
||||
my $dayEpoch = DateTime->from_epoch(epoch => $wgbday)->subtract(days => 10)->epoch;
|
||||
is($dt->epochToHuman($dayEpoch,'%D'), '6', '... single digit day');
|
||||
is($dt->epochToHuman($dayEpoch,'%H'), '8', '... single digit hour');
|
||||
|
||||
sub installBadLocale {
|
||||
copy(
|
||||
WebGUI::Test->getTestCollateralPath('BadLocale.pm'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue