diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index fb4aa830ea0..0ef7115ba21 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -5198,8 +5198,11 @@ class Form
$more .= '
' . $input['label'] . '
';
$more .= '
';
$addnowlink = (empty($input['datenow']) ? 0 : 1);
- $h = $input['hours'] ?: 0;
- $m = $input['minutes'] ?: 0;
+ $h = $m = 0;
+ if ($input['type'] == 'datetime) {
+ $h = isset($input['hours']) ? $input['hours'] : 1;
+ $m = isset($input['minutes']) ? $input['minutes'] : 1;
+ }
$more .= $this->selectDate($input['value'], $input['name'], $h, $m, 0, '', 1, $addnowlink);
$more .= '
'."\n";
$formquestion[] = array('name'=>$input['name'].'day');