Skip to content
Snippets Groups Projects
Commit f2c3bc19 authored by John Voskuilen's avatar John Voskuilen
Browse files

Issue #3409766: Introduce ItemSeasonHeader class

parent bc5dd816
No related branches found
No related tags found
No related merge requests found
......@@ -94,13 +94,16 @@ class OfficeHoursFormatterTableSelectList extends OfficeHoursFormatterTable {
// Use the 'open_text' and 'current' slot to set the title.
$current_item = $items->getCurrentSlot();
if ($current_item) {
// Get details from currently open slot.
$item = $hours_formatter['#office_hours'][$current_item->day];
$formatted_slots = $item['formatted_slots'];
// For this title, print only the weekday, not the exception date.
// $settings['exceptions']['date_format'] = $settings['day_format'];
$settings['exceptions']['date_format'] = 'l';
// There might be some confusion with yesterday after midnight.
$label = OfficeHoursItem::formatLabel($settings, ['day' => $current_item->getWeekday()]);
$status_text = $this->t(Html::escape($settings['current_status']['open_text']));
$title = $status_text . ' ' . $label . ' ' . $formatted_slots;
$title = implode(' ', [
$status_text = $this->t(Html::escape($settings['current_status']['open_text'])),
$label = $current_item->getLabel($settings),
$formatted_slots = $current_item->formatTimeSlot($settings),
]);
}
else {
$status_text = $this->t(Html::escape($settings['current_status']['closed_text']));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment