As the title says I'm trying to use Carbon's diffForHumans but the output only ever returns ago
or before
. I'm not using it as part of any framework just adding it standalone to my project.
Here's the code I'm using to test it, that should work just fine.
require 'vendor/autoload.php';
use Carbon\Carbon;
echo "<pre>";
$dt = Carbon::createFromDate(2011, 8, 1);
echo $dt->diffForHumans($dt->copy()->addMonth()); // 1 month before
echo $dt->diffForHumans($dt->copy()->subMonth()); // 1 month after
echo "</pre>";
Actual output is beforeafter
.
composer.lock shows I'm using version 2.50.0 and I'm using php version 7.2.24
symfony/translation v4.4.27 broke initial translations for Carbon, upgrade nesbot/carbon to >= 2.51.0.