Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Fieldtypes/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']),
];
}

Expand Down
17 changes: 17 additions & 0 deletions tests/Fieldtypes/DateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
Loading