https://dev.to/100r0bh If you have used Carbon Class in PHP, then you might have heard about the method Carbon::diffForHumans().

If the difference is more than 60 minutes, the output would be in hours and so on.

The Component had a prop of seconds which would hold the number of seconds that timer would need to display.

Now, we would format the getTimeElapsed method so that it would return the data similar to Carbon method.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners