Skip to content

Commit

Permalink
Merge pull request #457 from felixhahnweilheim/enh-canceled
Browse files Browse the repository at this point in the history
Canceled Events: add CSS class
  • Loading branch information
luke- authored Feb 19, 2024
2 parents 577925e + 2879be6 commit ace8497
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
13 changes: 6 additions & 7 deletions models/fullcalendar/FullCalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ public static function getFullCalendarArray(CalendarEventIF $entry)
// $result['rrule'] = $entry->getRrule();
// $result['exdate'] = $entry->getExdate();
}

// Add CSS class for canceled events
if($entry instanceof CalendarEventStatusIF && $entry->getEventStatus() === CalendarEventStatusIF::STATUS_CANCELLED) {
$result['className'] = 'canceled';
}

return $result;
}
Expand Down Expand Up @@ -121,13 +126,7 @@ private static function getEndDate(CalendarEventIF $entry)

private static function getTitle(CalendarEventIF $entry)
{
$title = $entry->getTitle();

if($entry instanceof CalendarEventStatusIF && $entry->getEventStatus() === CalendarEventStatusIF::STATUS_CANCELLED) {
$title .= ' ('.Yii::t('CalendarModule.base', 'canceled').')';
}

return $title;
return $entry->getTitle();
}

/**
Expand Down
7 changes: 7 additions & 0 deletions resources/css/calendar.css
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,13 @@ a.fc-event,
line-height: 50%; /* */
}

/* Canceled Events */
.fc-view .canceled .fc-content,
.fc-view .canceled .fc-content div,
.fc-view .canceled.fc-list-item {
text-decoration: line-through;
}


/* Horizontal Events
------------------------------------------------------------------------*/
Expand Down
Loading

0 comments on commit ace8497

Please sign in to comment.