<?php $pattern = '/^Regular Season$/i'; ?>

<?php foreach ($schedules as $schedule): ?>
        <?php if (preg_match($pattern, $schedule['type'])): ?>
            <tr>
                <th><?php echo $schedule['type']; ?></th>
                <td>
                    <?php
                        try {
                            $d = DateTime::createFromFormat('Y-m-d H:i:s', $schedule['start_date']);
                            $date_status = $d && $d->format('Y-m-d H:i:s') == $schedule['start_date'];

                            if ($date_status) {
                                echo $d->format('D m/d');
                            } else {
                                echo $schedule['start_date'];
                            }
                        } catch (\Exception $exception) {
                            //
                        }
                    ?>
                </td>
                <td>
                    <?php
                        if ($team_id != $schedule['visitor_team_id']) {
                            $team_field = $team_name = $block_team_schedules->get_team_name($schedule['visitor_team_id']);
                        } else {
                            $team_field = $block_team_schedules->get_team_name($schedule['home_team_id']);
                        }

                        echo $team_field;
                    ?>
                </td>
                <td>L 16 - 20</td>
            </tr>
        <?php endif; ?>
<?php endforeach; ?>
