From c888f77b00565c7ec78b054cc41421e588085dfa Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Mon, 9 Feb 2026 16:43:41 +0100 Subject: [PATCH 1/2] Avoid calling `->startOfDay()` on date range dates --- src/Fieldtypes/Date.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Fieldtypes/Date.php b/src/Fieldtypes/Date.php index fb7b6016e4c..c4dc409b1e2 100644 --- a/src/Fieldtypes/Date.php +++ b/src/Fieldtypes/Date.php @@ -302,8 +302,8 @@ public function augment($value) if ($this->config('mode') === 'range') { return [ - 'start' => $this->parseSaved($value['start'])->startOfDay(), - 'end' => $this->parseSaved($value['end'])->startOfDay(), + 'start' => $this->parseSaved($value['start']), + 'end' => $this->parseSaved($value['end']), ]; } From fba08ade29aca55969868d31cde19aa2e3ac4472 Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Fri, 20 Feb 2026 16:32:40 -0500 Subject: [PATCH 2/2] add test --- tests/Fieldtypes/DateTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/Fieldtypes/DateTest.php b/tests/Fieldtypes/DateTest.php index 8a2d51a7242..bbb49a4e2e0 100644 --- a/tests/Fieldtypes/DateTest.php +++ b/tests/Fieldtypes/DateTest.php @@ -123,6 +123,23 @@ public function it_augments_a_range() $this->assertEquals('2013 Feb 06 00:00', $augmented['end']->format('Y M d H:i')); } + #[Test] + public function it_augments_a_range_in_a_positive_offset_timezone() + { + config()->set('app.timezone', 'Europe/Berlin'); + + $augmented = $this->fieldtype(['mode' => 'range'])->augment([ + 'start' => '2026-02-02', + 'end' => '2026-02-05', + ]); + + $this->assertIsArray($augmented); + $this->assertInstanceOf(Carbon::class, $augmented['start']); + $this->assertInstanceOf(Carbon::class, $augmented['end']); + $this->assertEquals('2026 Feb 02', $augmented['start']->setTimezone('Europe/Berlin')->format('Y M d')); + $this->assertEquals('2026 Feb 05', $augmented['end']->setTimezone('Europe/Berlin')->format('Y M d')); + } + #[Test] public function it_augments_a_null_range() {