Javascript library that manipulates dates like Carbon? [closed]
Asked Answered
P

1

17

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.

Picturize answered 8/5, 2015 at 10:9 Comment(1)
You are looking for moment.js.Sterile
C
29

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"
Chanty answered 8/5, 2015 at 10:14 Comment(1)
Looks fantastic. Than you so much.Picturize

© 2022 - 2024 — McMap. All rights reserved.