Relative Timestamps Update Plugin - timeago

Relative Timestamps Update Plugin - timeago
File Size: 56 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

timeago is a smart and useful jQuery Plugin for updating fuzzy timestamps in your document automatically and intelligently. It supports almost all the major languages.

For Example:

  • You opened this page x minutes ago. 
  • This page was last modified x months ago.
  • Ryan was born xx years ago.
  • ...

You might also like:

Basic Usage:

1. Include jQuery library and jQuery timeago plugin on your page

<script src="jquery.min.js" type="text/javascript"></script>
<script src="jquery.timeago.js" type="text/javascript"></script>

2.  Add a date timestamp in ISO 8601 format

<abbr class="timeago" title="2013-04-01T06:24:17Z">December 17, 2011</abbr>
<time class="timeago" datetime="2013-04-01T06:24:17Z">December 17, 2011</time>

3. Call the plugin

<script type="text/javascript">
   jQuery(document).ready(function() {
     $("abbr.timeago").timeago();
   });
</script>

4. Optional settings.

refreshMillis: 60000,
allowPast: true,
allowFuture: false,
localeTitle: false,
cutoff: 0,
autoDispose: true,
strings: {
  prefixAgo: null,
  prefixFromNow: null,
  suffixAgo: "ago",
  suffixFromNow: "from now",
  inPast: 'any moment now',
  seconds: "less than a minute",
  minute: "about a minute",
  minutes: "%d minutes",
  hour: "about an hour",
  hours: "about %d hours",
  day: "a day",
  days: "%d days",
  month: "about a month",
  months: "%d months",
  year: "about a year",
  years: "%d years",
  wordSeparator: " ",
  numbers: []
}

Change Logs:

v1.5.4 (2017-01-20)

  • update and bugfix

v1.5.3 (2016-06-25)

  • update and bugfix

v1.5.2 (2016-02-13)

  • update

v1.5.1 (2016-02-04)

  • update

v1.5.0 (2016-01-22)

  • update

v1.4.3 (2015-09-19)

  • update

v1.4.2 (2015-08-29)

  • update

v1.4.1 (2014-05-02)

  • Added allowPast setting

v1.4.0 (2014-03-03)

  • Added updateFromDOM function; bug fixes; bower support

v1.3.2 (2014-02-28)

  • update.

v1.3.1 (2013-12-27)

  • Added support for 2-digit time zone designators

v1.3.0 (2013-06-17)

  • Added updateFromDOM function

v1.2.0 (2013-05-19)

  • Added cutoff setting

 


This awesome jQuery plugin is developed by rmm5t. For more Advanced Usages, please check the demo page or visit the official website.