Skip to content

Commit

Permalink
SAK-33755 - Posting assignment due date to calendar does not add it t…
Browse files Browse the repository at this point in the history
…o the day or weekly view (sakaiproject#6449)
  • Loading branch information
jonespm authored and bjones86 committed Jan 8, 2019
1 parent cbd7da8 commit e6bf33b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3287,11 +3287,10 @@ protected Vector getNewEvents(int year, int month, int day, CalendarActionState
boolean firstTime = true; // Don't need to do complex checking the first time.
Vector events = new Vector(); // A vector of vectors, each of the vectors containing a range of previous events.

//This +1 and -1 here are from SAK-13120 to work around an issue with endTime being included and not adding correctly
Time timeObj = TimeService.newTimeLocal(year,month,day,time,00,00,000+1);
Time timeObj = TimeService.newTimeLocal(year,month,day,time,00,00,000);

long duration = ((30*60)*(1000));
Time updatedTime = TimeService.newTime(timeObj.getTime()+ duration-1);
Time updatedTime = TimeService.newTime(timeObj.getTime()+ duration);

/*** include the start time ***/
TimeRange timeRangeObj = TimeService.newTimeRange(timeObj,updatedTime,true,false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,18 @@
#set ($startTime = $dStart.get($n))
#end

## This is a fudged endtime it will not include work if the endtime is intended to be included
#set ($endTime = $event.getRange().lastTime(0))
#set ($endTimeActual = $event.getRange().lastTime())

#if ($endTime.after($dEnd.get($n)))
## use the page end time as event's first time temporarily
#set ($endTime = $dEnd.get($n))
#end

#set ($du = $endTime.getTime().intValue() - $startTime.getTime().intValue())
## The Real non-fudged endtime
#set ($dureal = $endTime.getTime().intValue() - $startTime.getTime().intValue())
#set($dhour = $helper.getduration($du.longValue(),3600000))
#set($dminute = $helper.getFractionIn($du.longValue(),$dhour))

Expand All @@ -353,6 +358,7 @@

#set ($rowspan = 1)
#set ($startMinInt = $startTime.breakdownLocal().getMin())
## $event.getDisplayName():$startTime:$endTime:$startMinInt:$duMin<br>
#if ($startMinInt <30)
#set ($rowspan = $rowspan + (($duMin - (30 - $startMinInt))/30))
#set ($oneMore = ($duMin - (30 - $startMinInt))%30)
Expand All @@ -363,8 +369,13 @@
#end
###set ($oneMore = ($duMin - (30 - $startMinInt))%30)
#if ($oneMore > 0)
#set ($rowspan = $rowspan + 1)
#set ($rowspan = $rowspan + 1)
#end
## This endtime may have been fudged, if so it will need an extra row as it's being returned from getNewEvents
#if ($endTime != $endTimeActual)
#set ($rowspan = $rowspan + 1)
#end

#end ## endof macro-rowspan


Expand Down

0 comments on commit e6bf33b

Please sign in to comment.