uptodate.js is a library for auto updating time elements
How often do you use designs like "5 minutes ago", "Half an hour ago" on your site? And what if the user opened the tab and forgot about it for a couple of hours? “5 minutes ago” clearly loses its relevance. It is to correct this unfortunate misunderstanding that uptodate.js serves.
')
Using
Prepare timestamps in content. By default, uptodate takes a value from the data-time attribute that must contain a timestamp (number of milliseconds since epoch (00:00:00 UTC on 1970 January 1970)) for example
Posted: <spanclass="uptodate"data-time="1367180233904"> 4 minutes ago <span>
Deploy the library. All you need to do is call the only uptodate () method. You can transfer optional parameters to the call, the list of which is available on the office For example: