info can be supplied in one of two ways. * * The first is to provide a relative_range_id which is converted into start, end, and label. * * The second is to provide explicit start and end fields which will be used as is. * * @return Date_Range */ private function get_date_range() : Date_Range { $relative_range_id = $this->get_field('relative_range_id'); $exact_start = $this->get_field('exact_start'); $exact_end = $this->get_field('exact_end'); if (!\is_null($exact_start) && !\is_null($exact_end)) { try { $start = new DateTime($exact_start, Timezone::site_timezone()); $end = new DateTime($exact_end, Timezone::site_timezone()); return new Exact_Date_Range($start, $end); } catch (Throwable $e) { // Do nothing and fall back to default relative date range } } return new Relative_Date_Range($relative_range_id); } }