Javascript library that manipulates dates like Carbon?

I have been working with Laravel after a while, and I'm in love with instances of the Carbon time stamp and how easy it is to manipulate them and convert them to readable dates.

But right now I'm working on a project in which the interface is completely separate from the external end, and I canโ€™t name the methods of the Carbon API to convert the date to a human readable format.

Is there a Javascript library that does the same manipulations as Carbon, so I can use it in front-end templates and embed human readable time formats in my views.

+6
source share
1 answer

You must definitely watch

moment.js

It provides a clear and enjoyable interface. ie:

var start = moment([2007, 0, 5]); var end = moment([2007, 0, 10]); end.from(start); // "in 5 days" end.from(start, true); // "5 days" 
+14
source

Source: https://habr.com/ru/post/986813/


All Articles