I am working with Laravel since a while now and I am in love with the Carbon time stamp instances and how easy it is to manipulate them and convert them to human readable dates to display.
But right now I am working on a project where the front end is completely decoupled from the back end and I cannot call the Carbon API methods to convert the date into human readable format.
Is there a Javascript library which does the same manipulations like Carbon so that I can use it in front end templates and inject the human readable time formats into my views.
You should definitely look at
moment.js
It provides a clear and nice to use interface i.e.:
var start = moment([2007, 0, 5]);
var end = moment([2007, 0, 10]);
end.from(start); // "in 5 days"
end.from(start, true); // "5 days"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With