Skip to content

Commit

Permalink
Merge pull request #816 from pimcore/add-carbon
Browse files Browse the repository at this point in the history
add nesbot/carbon to composer
  • Loading branch information
alexz707 authored Feb 13, 2025
2 parents d486071 + 3f3b2ac commit 3b65df8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
"php": "~8.3.0 || ~8.4.0",
"cbschuld/browser.php": "^1.9.6",
"endroid/qr-code": "^6.0.1",
"nesbot/carbon": "^3.8.4",
"phpoffice/phpspreadsheet": "^2.2 || ^3.3",
"pimcore/pimcore": "^12.x-dev",
"pimcore/pimcore": "^12.0",
"symfony/webpack-encore-bundle": "^1.17 || ^2.0"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion src/DataObject/GridColumnConfig/Operator/DateFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function format(mixed $theValue): string
{
$timestamp = null;
if (is_int($theValue)) {
$theValue = Carbon::createFromTimestamp($theValue);
$theValue = Carbon::createFromTimestamp($theValue, date_default_timezone_get());
}
if ($theValue instanceof Carbon) {
$timestamp = $theValue->getTimestamp();
Expand Down
2 changes: 1 addition & 1 deletion src/Helper/QueryParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static function getFilterCondition(string $filterString, array $matchExac
*
* filter: {type : 'date',dateFormat: 'timestamp'}
*/
$date = Carbon::createFromTimestamp($f->value)->setTime(0, 0, 0);
$date = Carbon::createFromTimestamp($f->value, date_default_timezone_get())->setTime(0, 0, 0);

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

0 comments on commit 3b65df8

Please sign in to comment.