Closed JayGeorge closed 9 months ago
Ah, we probably need to make the now
variable immutable.
I'm in the process of making my first pull request shhhhh
🤐
We merged #9114 today which will allow you to prevent the date from being modified. Simply add the following to the boot
method in your AppServiceProvider
:
\Illuminate\Support\Facades\Date::use(\Carbon\CarbonImmutable::class);
Bug description
Using
now | modify_date
more than once causes calculation errors.For example:
Would result in:
This if you try to filter a collection like this:
{{ collection:something sort="date:asc" as="entries" date:is_after='{now|modify_date("next monday")}' date:is_before='{now|modify_date("next monday + 7 days")}' }}
you'd get unexpected resultsHow to reproduce
Try:
and see how you'll get:
Rather than what you'd expect:
Logs
No response
Environment
Installation
Starter Kit using via CLI
Antlers Parser
runtime (new)
Additional details
No response