Skip to content

Commit

Permalink
Don't show exceptions in the iTip viewer that are in the past.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jul 29, 2014
1 parent 674e911 commit ea60603
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion imp/lib/Mime/Viewer/Itip.php
Expand Up @@ -436,7 +436,9 @@ protected function _vEvent($vevent, $id, $method = 'PUBLISH', $components = arra
foreach ($components as $key => $component) {
try {
if ($component->getAttribute('RECURRENCE-ID') && $component->getAttribute('UID') == $vevent->getAttribute('UID')) {
$view->exceptions[] = $this->_vEventException($component, $key, $method);
if ($ex = $this->_vEventException($component, $key, $method)) {
$view->exceptions[] = $ex;
}
}
} catch (Horde_Icalendar_Exception $e) {}
}
Expand Down Expand Up @@ -545,6 +547,11 @@ protected function _vEventException($vevent, $id, $method = 'PUBLISH')

try {
$end = $vevent->getAttribute('DTEND');
// Check for exceptions that are over and done with.
$d = new Horde_Date($end);
if ($d->timestamp() < time()) {
return false;
}
$view->end = is_array($end)
? strftime($prefs->getValue('date_format'), mktime(0, 0, 0, $end['month'], $end['mday'], $end['year']))
: strftime($prefs->getValue('date_format'), $end) . ' ' . date($prefs->getValue('twentyFour') ? ' G:i' : ' g:i a', $end);
Expand Down

0 comments on commit ea60603

Please sign in to comment.