formatTitle( $service['name'], $service['dateOpen'], $service['dateClose'] ); // Construct the content $content = sprintf( '
%s
Scheduled closure on %s.
', $service['description'], $service['dateClose'] ); // Add the item to the feed $this->items[] = [ 'title' => $title, 'uid' => $service['slug'], 'uri' => $service['link'], 'content' => $content ]; } } private function formatTitle($name, $dateOpen, $dateClose) { // Extract years from dateOpen and dateClose $yearOpen = date('Y', strtotime($dateOpen)); $yearClose = date('Y', strtotime($dateClose)); // Format the title return "{$name} ({$yearOpen} - {$yearClose})"; } }