Closed sts-ryan-holton closed 8 months ago
Hello, it's difficult to see what's the issue since I don't know what line matches the 109
of your MonitorController.php
file.
Can you make a minimum code sample free of DB/application context so that I can run it as is on my side and reproduce your error?
Line 109 is:
$to = Carbon::now()->setTimezone($user->timezone)->addHours($diff)->toDateTimeString();
I figured it might be something to do with the breaking change to how diffIn*
methods work. So I've wrapped these in the (int)
checks
It's weird because echo Carbon::now()->addHours(0.5)->toDateTimeString();
is working on both Carbon 2 and 3. So float vs. int should not break it.
If you can provide a reproductible code chunk, I would re-open the issue.
Hello,
I encountered an issue with the following code within my recently upgraded Laravel 11 project that was previously using the latest version of Carbon PHP v2, now, using the latest of v3 I'm experiencing an intermittent problem with some code
Carbon version: 3.1.1
PHP version: 8.3.4
I expected to get:
Ideally not an error since coming from v2 there's no issue and i can't find an upgrade guide for carbon v3
But I actually get:
Thanks!