Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexz707 committed Feb 13, 2025
1 parent 39932ab commit 828796a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/Model/DefaultSearch/Query/DateFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ public function __construct(
int|Carbon|null $onTimestamp = null,
private bool $roundToDay = true,
) {
$this->startDate = is_int($startTimestamp) ? Carbon::createFromTimestamp($startTimestamp, date_default_timezone_get()) : $startTimestamp;
$this->endDate = is_int($endTimestamp) ? Carbon::createFromTimestamp($endTimestamp, date_default_timezone_get()) : $endTimestamp;
$this->onDate = is_int($onTimestamp) ? Carbon::createFromTimestamp($onTimestamp, date_default_timezone_get()) : $onTimestamp;
$this->startDate = is_int($startTimestamp) ?
Carbon::createFromTimestamp($startTimestamp, date_default_timezone_get()) : $startTimestamp;
$this->endDate = is_int($endTimestamp) ?
Carbon::createFromTimestamp($endTimestamp, date_default_timezone_get()) : $endTimestamp;
$this->onDate = is_int($onTimestamp) ?
Carbon::createFromTimestamp($onTimestamp, date_default_timezone_get()) : $onTimestamp;
}

public static function createFromArray(string $field, array $params, bool $roundToDay = true): DateFilter
Expand Down
3 changes: 2 additions & 1 deletion src/Model/Search/Modifier/Filter/FieldType/DateFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public function __construct(
) {
$this->startDate = is_int($startDate) ? Carbon::createFromTimestamp($startDate, date_default_timezone_get()) :
$startDate;
$this->endDate = is_int($endDate) ? Carbon::createFromTimestamp($endDate, date_default_timezone_get()) : $endDate;
$this->endDate = is_int($endDate) ? Carbon::createFromTimestamp($endDate, date_default_timezone_get()) :
$endDate;
$this->onDate = is_int($onDate) ? Carbon::createFromTimestamp($onDate, date_default_timezone_get()) : $onDate;
}

Expand Down

0 comments on commit 828796a

Please sign in to comment.