Problem with month translation in Filters - related to Carbon?
We have a very interesting issue with months translated through
src/Filters/QueryBuilder/Constraints/DateConstraint/Operators/IsMonthOperator.php:getMonths()
:
Result:
The list of month is off since a little bit:
However this problem is not related to filament, it seems to be a bug with Carbon, confirmed via the Carbon SandBox:
https://play.phpsandbox.io/embed/nesbot/carbon
what would work is adding setDay(1).
Does anyone have any idea what causes this? Should I open a PR to add this to filament?
Carbon Issue: https://github.com/briannesbitt/Carbon/issues/3097GitHub
Translated months names off · Issue #3097 · briannesbitt/Carbon
Hello, I encountered an issue with the following code: foreach (range(1,12) as $month) { echo \Carbon\Carbon::now()->setMonth($month)->getTranslatedMonthName() . '<br>'; } Carbo...
4 Replies
After some digging, this seems to be related to https://github.com/briannesbitt/Carbon/issues/2317 - So basically on the 31st on each month, the month selector filter breaks. I think this deserves a fix in filament itself.
GitHub
Potentional bug with
->month() && ->setMonth()
Overflow vs. noOve...Hello, I encountered an issue with the following code: $start = Carbon::parse('2021-03-31 23:00:00'); $start->month(4); echo $start; I reckon this should use noOverflow behind the scenes...
If the issues is in carbon what can filament do about it.?
We can fix it in filament 🙂 Dan already merged my pr