Closed buddhaCode closed 2 months ago
Could you share your code?
Sure. The code is pretty basic:
DateRangeFilter::make('valued_at')
->label('Wertstellung am')
->timezone(config('app.display_timezone'))
->displayFormat('DD.MM.YYYY')
->format('d.m.Y')
->withIndicator()
->useRangeLabels(),
Did I describe the intention of the feature correctly?
DateRangeFilter::make('valued_at') ->label('Wertstellung am') ->timezone(config('app.display_timezone')) ->displayFormat('DD.MM.YYYY') ->format('d.m.Y') ->withIndicator() ->useRangeLabels(),
It works fine at my end, could you share a reproduction repo
I found the cause of the issue. I am using Date::use(CarbonImmutable::class);
in my AppServiceProvider
. So all my dates are immutable. When I comment that out, it works perfectly fine. But I'm not sure why this is an issue, because this feature is totally JavaScript based.
public static function table(Table $table): Table
{
Date::use(CarbonImmutable::class);
return $table
->columns([
TextColumn::make('test')
->date(),
])
->filters([
DateRangeFilter::make('test')
]);
}
Thanks for reporting
Do you have any idea why using immutables influences this feature?
The package is not using immutable Carbon and might have made a mismatch when comparing dates
I can't get this feature to work. I can simply see no difference in my GUI.
With
useRangeLabels()
:The field should contain "Letzten 7 Tage" and not "25.07.2024 - 31.07.2024", shouldn't it?
Without
useRangeLabels()
: