mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 14:18:27 +01:00
Fix format date to mysql on date stream filter (#5825)
* Fix format date to mysql on date stream filter * Update CHANGELOG.md (#5825)
This commit is contained in:
parent
e33a9fad16
commit
a1af6f64f8
@ -4,6 +4,7 @@ HumHub Changelog
|
|||||||
1.12.1 (Unreleased)
|
1.12.1 (Unreleased)
|
||||||
----------------------
|
----------------------
|
||||||
- Fix #5822: Fix content width in mobile view
|
- Fix #5822: Fix content width in mobile view
|
||||||
|
- Fix #5825: Fix format date to mysql on date stream filter
|
||||||
|
|
||||||
1.12.0 (July 27, 2022)
|
1.12.0 (July 27, 2022)
|
||||||
----------------------
|
----------------------
|
||||||
|
@ -70,9 +70,10 @@ class DateStreamFilter extends StreamQueryFilter
|
|||||||
{
|
{
|
||||||
$localeDateFormat = FormatConverter::convertDateIcuToPhp(Yii::$app->formatter->dateInputFormat);
|
$localeDateFormat = FormatConverter::convertDateIcuToPhp(Yii::$app->formatter->dateInputFormat);
|
||||||
$timeZone = new DateTimeZone(Yii::$app->formatter->timeZone);
|
$timeZone = new DateTimeZone(Yii::$app->formatter->timeZone);
|
||||||
|
$dateTime = DateTime::createFromFormat($localeDateFormat, $date, $timeZone);
|
||||||
|
$mysqlDateFormat = 'Y-m-d';
|
||||||
|
|
||||||
return DateTime::createFromFormat($localeDateFormat, $date, $timeZone)
|
return $dateTime ? $dateTime->format($mysqlDateFormat) : date($mysqlDateFormat);
|
||||||
->format('Y-m-d');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function isFilteredFrom(): bool
|
private function isFilteredFrom(): bool
|
||||||
|
Loading…
x
Reference in New Issue
Block a user