Fork

jQuery Age

Age is a jQuery plugin that formats and tracks dates and times as human readable text.

Example

Example #1:

Example #2:

Example #3:

Example #4:

Example #5:

Example #6:

Example #7:

Example #8:

Installation

To install download one of these packages and include the jquery.age.js file in your head with the following:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js" type="text/javascript"></script>
<script src="javascript/jquery.age.js" type="text/javascript"></script>

Example

Setting up a date or time is easy. The following snippet is a good start:

<time datetime="2010-01-01T12:00:00Z" class="age">January 1, 2010 12:00</time>
<time datetime="2020-01-01T12:00:00Z" class="age">January 1, 2020 12:00</time>
<script type="text/javascript">
  $('.age').age();
</script>

Copyright (c) 2013 - 2013 Kevin Sylvestre