diff --git a/typo3/sysext/core/Classes/Database/QueryGenerator.php b/typo3/sysext/core/Classes/Database/QueryGenerator.php index f0a7ca3f8304..ece16b33b7d1 100644 --- a/typo3/sysext/core/Classes/Database/QueryGenerator.php +++ b/typo3/sysext/core/Classes/Database/QueryGenerator.php @@ -1268,6 +1268,13 @@ public function getQuery($queryConfig, $pad = '') ksort($queryConfig); $first = 1; foreach ($queryConfig as $key => $conf) { + // Convert ISO-8601 timestamp (string) into unix timestamp (int) + if (strtotime($conf['inputValue'])) { + $conf['inputValue'] = strtotime($conf['inputValue']); + if ($conf['inputValue1'] && strtotime($conf['inputValue1'])) { + $conf['inputValue1'] = strtotime($conf['inputValue1']); + } + } switch ($conf['type']) { case 'newlevel': $qs .= LF . $pad . trim($conf['operator']) . ' (' . $this->getQuery($queryConfig[$key]['nl'], ($pad . ' ')) . LF . $pad . ')'; @@ -1353,6 +1360,8 @@ public function cleanInputVal($conf, $suffix = '') } else { $inputVal = 0; } + } elseif (strtotime($conf['inputValue' . $suffix])) { + $inputVal = $conf['inputValue' . $suffix]; } else { $inputVal = (float)$conf['inputValue' . $suffix]; } @@ -1660,20 +1669,19 @@ public function getSelectQuery($qString = ''): string /** * @param string $name the field name - * @param int $timestamp the unix timestamp + * @param string $timestamp ISO-8601 timestamp * @param string $type [datetime, date, time, timesec, year] * * @return string */ protected function getDateTimePickerField($name, $timestamp, $type) { - $dateFormat = $GLOBALS['TYPO3_CONF_VARS']['SYS']['USdateFormat'] ? '%H:%M %m-%d-%Y' : '%H:%M %d-%m-%Y'; - $value = ($timestamp > 0 ? strftime($dateFormat, $timestamp) : ''); + $value = strtotime($timestamp) ? date($GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], strtotime($timestamp)) : ''; $id = StringUtility::getUniqueId('dt_'); $html = []; $html[] = '
'; $html[] = ' '; - $html[] = ' '; + $html[] = ' '; $html[] = ' '; $html[] = '