Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canceled Events: add CSS class #457

Merged
merged 5 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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