feat(dump): date-range filter, sortable columns, native date formatting #10
@@ -54,10 +54,14 @@ class DumpController
|
||||
}
|
||||
|
||||
/**
|
||||
* The datepicker emits ISO-8601 UTC strings (e.g. "2026-03-01T00:00:00.000Z")
|
||||
* in date mode. An empty bound (no date set) stays null so the range is open
|
||||
* on that side. The "to" side is widened to end-of-day so selecting a date
|
||||
* includes every dump created that day, not just before midnight.
|
||||
* The admin's date filter sends mixed shapes: the "from" bound is a naive local
|
||||
* date string with no timezone marker (e.g. "2026-03-01T00:00:00"), while
|
||||
* sw-date-filter widens "to" to end-of-day client-side via `Date#toISOString()`,
|
||||
* which is always UTC (e.g. "2026-03-01T23:59:59.000Z"). Re-expressing both in
|
||||
* PHP's default timezone (the same one DumpFilenameParser uses) before applying
|
||||
* our own day-boundary keeps the calendar day the user actually picked, regardless
|
||||
* of which shape arrived. An empty bound (no date set) stays null so the range is
|
||||
* open on that side.
|
||||
*/
|
||||
private function parseBoundDate(?string $value, bool $endOfDay): ?\DateTimeImmutable
|
||||
{
|
||||
@@ -66,7 +70,7 @@ class DumpController
|
||||
}
|
||||
|
||||
try {
|
||||
$dateTime = new \DateTimeImmutable($value);
|
||||
$dateTime = (new \DateTimeImmutable($value))->setTimezone(new \DateTimeZone(date_default_timezone_get()));
|
||||
} catch (\Exception) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user