Skip to content

Commit

Permalink
Fix the Indication message on Date Filter for Between
Browse files Browse the repository at this point in the history
  • Loading branch information
kingmaker-agm committed Jul 26, 2023
1 parent 8fd49dd commit f31f483
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Filters/DateFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ protected function setUp(): void
return [$message . ' ' . $state['period_value'] . ' ' . $state['period'] . ' ' . $state['direction']];
}

if ($state['value']) {
return [$message . ' ' . Carbon::parse($state['value'])->format(config('tables.date_format', 'Y-m-d'))];
}
if ($state['from'] || $state['until']) {
if ($state['clause'] === self::CLAUSE_BETWEEN) {
return [
$message . ' ' .
($state['from'] ? Carbon::parse($state['from'])->format(config('tables.date_format', 'Y-m-d')) : 0) . ' and ' .
($state['until'] ? Carbon::parse($state['until'])->format(config('tables.date_format', 'Y-m-d')) : "~")
($state['from'] ? Carbon::parse($state['from'])->format(config('tables.date_format', 'Y-m-d')) : 0) . ' and ' .
($state['until'] ? Carbon::parse($state['until'])->format(config('tables.date_format', 'Y-m-d')) : "~")
];
}
if ($state['value']) {
return [$message . ' ' . Carbon::parse($state['value'])->format(config('tables.date_format', 'Y-m-d'))];
}
}

return [];
Expand Down

0 comments on commit f31f483

Please sign in to comment.