filament/filament
v3.2.137
v11.41.3
v3.5.12
8.3.4
This is the input:
public static function starts(): DatePicker
{
return DatePicker::make('starts_at')
->label(__('Starts at'))
->required()
->live()
->seconds(false)
->timezone('Europe/Amsterdam');
}
This is the model caster:
class Ticket extends Model
{
/**
* @var array<string, string>
*/
protected $casts = [
'starts_at' => 'date:Y-m-d',
];
}
When the filled date is 10-02-2025, and you save model changes, it will be saved as 09-02-2025 (day-1).
This happens on every save,even when setting a different date.
I know bugs reports exists, but even after appyling the date casting it still happens: #5601 (comment)
Removing the timezone
method fixes the issue, it also work fine when you set ->timezone('UTC')
(same timezone as application). But we need this conversion for international users, and we keep the application as UTC.
If you need more debug information, please let me know.
Thanks.
Timezone method working
->timezone('x')
https://github.com/francoism90/filament-dateinput-timezone
I don't have a log, if you need a value dump, please let me know.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too