From f0cc6e8ae70ab2a3b4c09af8cd0249d45d63ce34 Mon Sep 17 00:00:00 2001 From: campbell-m <87438215+campbell-m@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:18:33 +0100 Subject: [PATCH] Add type declarations and fix TypeError --- web/edit_entry.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/edit_entry.php b/web/edit_entry.php index 9b48bfef76..6b5c309fe7 100644 --- a/web/edit_entry.php +++ b/web/edit_entry.php @@ -119,7 +119,7 @@ function get_field_create_by(string $create_by, bool $disabled=false) } -function get_field_name($value, $disabled=false) +function get_field_name(string $value, $disabled=false) { $params = array('label' => get_vocab('namebooker'), 'name' => 'name', @@ -132,7 +132,7 @@ function get_field_name($value, $disabled=false) } -function get_field_description($value, $disabled=false) +function get_field_description(string $value, $disabled=false) { global $is_mandatory_field; @@ -1466,7 +1466,7 @@ function getbookingdate(int $t, bool $is_end=false) : array { $end_date = $start_date; } - list($end_year, $end_month, $end_day) = explode('-', $end_date); + list($end_year, $end_month, $end_day) = array_map('intval', explode('-', $end_date)); $end_time = mktime($end_hour, $end_minute, 0, $end_month, $end_day, $end_year); $duration = $end_time - $start_time - cross_dst($start_time, $end_time); }