forward porting Event dateSpan display fix and Event.t test
This commit is contained in:
parent
92c3652406
commit
0a1974ba4c
3 changed files with 80 additions and 12 deletions
|
|
@ -8,12 +8,12 @@
|
|||
- rfe: Added message to user search operation when user count exceeds 250.
|
||||
(Diona Kidd, Knowmad Technologies)
|
||||
|
||||
|
||||
7.4.16
|
||||
- fix: Event End Time Missing (perlDreamer Consulting, LLC.)
|
||||
http://www.plainblack.com/bugs/tracker/event-end-time-missing
|
||||
- fix: EMS - Adding Prerequisite sets.
|
||||
- fix: Multiple Instances of EMS displaying on View Purchase
|
||||
|
||||
|
||||
7.4.15
|
||||
- fix: Image asset test fails
|
||||
- fix: Article attachments don't obey max image dimentions
|
||||
|
|
|
|||
|
|
@ -1239,19 +1239,28 @@ sub getTemplateVars {
|
|||
? 1 : 0
|
||||
;
|
||||
|
||||
# Make a Friendly date span
|
||||
# Make a Friendly date span.
|
||||
$var{dateSpan}
|
||||
= $var{startDateDayName}.", "
|
||||
. $var{startDateMonthName}." "
|
||||
. $var{startDateDayOfMonth}." "
|
||||
. ( !$var{isAllDay} ? $var{startDateHour}.":".$var{startDateMinute}." ".$var{startDateM} : "" )
|
||||
. ( !$var{isOneDay} ?
|
||||
' • '
|
||||
. $var{endDateDayName}.", "
|
||||
.$var{endDateMonthName}." "
|
||||
.$var{endDateDayOfMonth}." "
|
||||
. ( !$var{isAllDay} ? $var{endDateHour}.":".$var{endDateMinute}." ".$var{endDateM} : "")
|
||||
: "");
|
||||
. $var{startDateDayOfMonth};
|
||||
if (! $var{isAllDay}) {
|
||||
$var{dateSpan} .= ' '.$var{startDateHour}.":".$var{startDateMinute}." ".$var{startDateM};
|
||||
}
|
||||
if (! $var{isOneDay}) {
|
||||
$var{dateSpan}
|
||||
.= ' • '
|
||||
. $var{endDateDayName}.", "
|
||||
. $var{endDateMonthName}." "
|
||||
. $var{endDateDayOfMonth}." "
|
||||
}
|
||||
elsif (! $var{isAllDay}) {
|
||||
$var{dateSpan}
|
||||
.= ' ‐ '
|
||||
}
|
||||
if (! $var{isAllDay}) {
|
||||
$var{dateSpan} .= ' '.$var{endDateHour}.":".$var{endDateMinute}." ".$var{endDateM};
|
||||
}
|
||||
|
||||
# Make some friendly URLs
|
||||
my $urlStartParam = $dtStart->cloneToUserTimeZone->truncate(to => "day");
|
||||
|
|
|
|||
59
t/Asset/Event.t
Normal file
59
t/Asset/Event.t
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2007 Plain Black Corporation.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use FindBin;
|
||||
use strict;
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::Asset::Event;
|
||||
|
||||
use Test::More; # increment this value for each test you create
|
||||
use Test::Deep;
|
||||
plan tests => 2;
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||
$versionTag->set({name=>"Adding Calendar for Event Asset Test"});
|
||||
my $defaultAsset = WebGUI::Asset->getDefault($session);
|
||||
my $cal = $defaultAsset->addChild({className=>'WebGUI::Asset::Wobject::Calendar'});
|
||||
$versionTag->commit;
|
||||
|
||||
my $properties = {
|
||||
# '1234567890123456789012'
|
||||
id => 'EventAssetTest00000012',
|
||||
title => 'Birthday of WebGUI',
|
||||
className => 'WebGUI::Asset::Event',
|
||||
url => 'event-asset-test',
|
||||
startDate => '2000-08-16', ##Times and dates have to be entered in UTC
|
||||
startTime => '23:00:00',
|
||||
endDate => '2000-08-17',
|
||||
endTime => '03:00:00',
|
||||
timeZone => 'America/Chicago',
|
||||
location => 'Madison, Wisconsin',
|
||||
};
|
||||
|
||||
my $event = $cal->addChild($properties, $properties->{id});
|
||||
|
||||
my $secondVersionTag = WebGUI::VersionTag->new($session, $event->get("tagId"));
|
||||
|
||||
is($event->isAllDay, 0, 'isAllDay is zero since it has a start and end time');
|
||||
|
||||
my %templateVars = $event->getTemplateVars();
|
||||
is($templateVars{dateSpan}, 'Wednesday, August 16 6:00 PM ‐ 10:00 PM', 'getTemplateVars: dateSpan bridges times on a single day');
|
||||
|
||||
END {
|
||||
# Clean up after thy self
|
||||
$versionTag->rollback;
|
||||
$secondVersionTag->rollback();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue