summaryrefslogtreecommitdiff
path: root/rt/share/html/Elements
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-04-12 19:18:27 -0700
committerIvan Kohler <ivan@freeside.biz>2014-04-12 19:18:27 -0700
commit9f1a3b2bd30562d52fa9d2d0c7afab08f5efff41 (patch)
tree197b586aa226b7f98084c83bf02df63efd363a1b /rt/share/html/Elements
parente6341bb01533cc32252676ea40bb94bbd2613a37 (diff)
installers (calendaring), RT#16584
Diffstat (limited to 'rt/share/html/Elements')
-rw-r--r--rt/share/html/Elements/CalendarSlotSchedule17
1 files changed, 10 insertions, 7 deletions
diff --git a/rt/share/html/Elements/CalendarSlotSchedule b/rt/share/html/Elements/CalendarSlotSchedule
index e94bddfe2..88202d417 100644
--- a/rt/share/html/Elements/CalendarSlotSchedule
+++ b/rt/share/html/Elements/CalendarSlotSchedule
@@ -1,31 +1,34 @@
<%ARGS>
+ $Date => undef,
@Tickets => ()
$slots => $default_slots,
$sday => undef,
$tod_row => undef,
$timestep => $default_timestep,
+ @username => ()
</%ARGS>
<%SHARED>
my @slots = ( [], [], [], [], [], [], [] );
</%SHARED>
-% warn $sday;
% #for my $t ( @{ $Tickets{$date->strftime("%F")} } ) {
% for my $t (@Tickets) {
%
-% #XXX off by 1h on daylight savings boundaries... 2 sundays a year
-% my $starts = ($t->StartsObj->Unix - $t->StartsObj->SetToMidnight(Timezone=>'user'))/60;
+% my($sm, $sh) = ($t->StartsObj->Localtime('user'))[1,2];
+% my $starts = $sh*60 + $sm;
%
-% if ( $starts >= $tod_row && $starts < ($tod_row + $timestep) ) {
+% if ( RTx::Calendar::LocalDate($t->StartsObj->Unix) eq $Date->strftime('%F') #today
+% && $starts >= $tod_row && $starts < ($tod_row + $timestep) ) {
% #then we're a new entry, find a slot for us
% my $s = 0;
% while ( ref($slots[$sday]->[$s]) ) { $s++ }
% $slots[$sday]->[$s] = [ $t->Id, $t ];
% }
%
-% #XXX also off by 1h on daylight savings boundaries
-% my $due = $t->DueObj->Unix - $t->DueObj->SetToMidnight;
+% my($dm, $dh) = ($t->DueObj->Localtime('user'))[1,2];
+% my $due = $dh*60 + $dm;
%
-% if ( $due <= $tod_row && $due > ($tod_row + $timestep ) ) {
+% if ( RTx::Calendar::LocalDate($t->DueObj->Unix) eq $Date->strftime('%F') #today
+% && $due <= $tod_row && $due > ($tod_row + $timestep ) ) {
% #then find our slot and remove us
% @{ $slots[$sday] } =
% map { (!ref($_) || $_->[0] != $t->Id) ? $_ : '' }