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")
|
* The admin's date filter sends mixed shapes: the "from" bound is a naive local
|
||||||
* in date mode. An empty bound (no date set) stays null so the range is open
|
* date string with no timezone marker (e.g. "2026-03-01T00:00:00"), while
|
||||||
* on that side. The "to" side is widened to end-of-day so selecting a date
|
* sw-date-filter widens "to" to end-of-day client-side via `Date#toISOString()`,
|
||||||
* includes every dump created that day, not just before midnight.
|
* 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
|
private function parseBoundDate(?string $value, bool $endOfDay): ?\DateTimeImmutable
|
||||||
{
|
{
|
||||||
@@ -66,7 +70,7 @@ class DumpController
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$dateTime = new \DateTimeImmutable($value);
|
$dateTime = (new \DateTimeImmutable($value))->setTimezone(new \DateTimeZone(date_default_timezone_get()));
|
||||||
} catch (\Exception) {
|
} catch (\Exception) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user