Allow users to enter 24:00:00 by hand, and have the Event handle it correctly. Fixes bug #11788

This commit is contained in:
Colin Kuskie 2010-09-13 11:04:03 -07:00
parent 14e571941e
commit 59bd99c243
2 changed files with 17 additions and 4 deletions

View file

@ -3,6 +3,7 @@
- fixed #11854: CS doesn't return Not Found page
- fixed #11746: Thingy import CSV only supports one line ending
- fixed #11833: Recheck for losing Product Images
- fixed #11788: Calendar - Can't enter Midnight - Broke page layout
7.10.0
- fixed #11812: Checking www_ajaxSave's response in the cart js, urlencoding post parameters

View file

@ -17,7 +17,6 @@ use WebGUI::Asset::Event;
use Test::More; # increment this value for each test you create
use Test::Deep;
plan tests => 20;
my $session = WebGUI::Test->session;
@ -120,9 +119,7 @@ my $eventStorage = WebGUI::Storage->create($session);
WebGUI::Test->addToCleanup($eventStorage);
$properties3->{storageId} = $eventStorage->getId;
my $event6 = $cal->addChild($properties3, $properties3->{id});
sleep 2;
my $event6 = $cal->addChild($properties3, $properties3->{id}, time()-5);
my $event6a = $event6->addRevision({ title => 'Event with storage', }, undef, { skipAutoCommitWorkflows => 1, });
ok($session->id->valid($event6a->get('storageId')), 'addRevision gives the new revision a valid storageId');
@ -149,3 +146,18 @@ is $event7->isHidden, 1, 'isHidden set to 1 by default';
$event7->isHidden(0);
is $event7->isHidden, 1, 'isHidden cannot be set to 0';
my $event7 = $cal->addChild({
className => 'WebGUI::Asset::Event',
startDate => '2000-08-31',
startTime => '24:00:00',
endDate => '2000-09-01',
endTime => '24:00:00',
});
is ($event7->get('startTime'), '00:00:00', 'startTime set to 00:00:00 if the hour is more than 23');
is ($event7->get('startDate'), '2000-09-01', 'startDate bumped by 1 day');
is ($event7->get('endTime'), '00:00:00', 'endTime set to 00:00:00 if the hour is more than 23');
is ($event7->get('endDate'), '2000-09-02', 'endDate bumped by 1 day');
done_testing;