Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript library that manipulates dates like Carbon? [closed]

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.

like image 682
Rohan Avatar asked May 08 '15 10:05

Rohan


1 Answers

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"
like image 61
miensol Avatar answered Sep 25 '22 00:09

miensol