79687383

Date: 2025-07-02 12:04:57
Score: 1
Natty:
Report link

I've found a way around the issue.

 public function get_session_range()
 {
        $sessions = $this->meta('programme_general_connected_sessions');

        $dates = array_map(fn($s) => $s->general_date_object(), $sessions->to_array());

        $earliestDate = !empty($dates) ? min($dates) : null;
        $latestDate   = !empty($dates) ? max($dates) : null;

        return ['earliest' => $earliestDate, 'latest' => $latestDate];
}

But I still have no clue why the first solution wouldn't work.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Joren Rothman