Skip to content

Commit 3b65df8

Browse files
authored
Merge pull request #816 from pimcore/add-carbon
add nesbot/carbon to composer
2 parents d486071 + 3f3b2ac commit 3b65df8

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
"php": "~8.3.0 || ~8.4.0",
1616
"cbschuld/browser.php": "^1.9.6",
1717
"endroid/qr-code": "^6.0.1",
18+
"nesbot/carbon": "^3.8.4",
1819
"phpoffice/phpspreadsheet": "^2.2 || ^3.3",
19-
"pimcore/pimcore": "^12.x-dev",
20+
"pimcore/pimcore": "^12.0",
2021
"symfony/webpack-encore-bundle": "^1.17 || ^2.0"
2122
},
2223
"require-dev": {

src/DataObject/GridColumnConfig/Operator/DateFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function format(mixed $theValue): string
9090
{
9191
$timestamp = null;
9292
if (is_int($theValue)) {
93-
$theValue = Carbon::createFromTimestamp($theValue);
93+
$theValue = Carbon::createFromTimestamp($theValue, date_default_timezone_get());
9494
}
9595
if ($theValue instanceof Carbon) {
9696
$timestamp = $theValue->getTimestamp();

src/Helper/QueryParams.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public static function getFilterCondition(string $filterString, array $matchExac
104104
*
105105
* filter: {type : 'date',dateFormat: 'timestamp'}
106106
*/
107-
$date = Carbon::createFromTimestamp($f->value)->setTime(0, 0, 0);
107+
$date = Carbon::createFromTimestamp($f->value, date_default_timezone_get())->setTime(0, 0, 0);
108108

109109
if ($f->operator == 'eq') {
110110
$conditions[$f->property][] = ' ' . $f->property . ' >= ' . $db->quote($date->getTimestamp());

0 commit comments

Comments
 (0)