User Friendly Time Formatting Plugin with jQuery - Age
File Size: | 175 KB |
---|---|
Views Total: | 848 |
Last Update: | |
Publish Date: | |
Official Website: | Go to website |
License: | MIT |
jQuery Age is a simple jQuery plugin that allows you to display the dates and times in a human friendly format like xx days ago, xx seconds ago, etc.
Basic usage:
1. Load the jQuery javascript library and jQuery Age on your web page
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js' type='text/javascript'></script> <script src='javascripts/jquery.age.js' type='text/javascript'></script>
2. Add a date timestamp in ISO 8601 format using <time>
element
<time class='age' datetime='2013-01-01T12:00:00Z'>January 1, 2010 12:00</time>
3. Call the plugin
<script> jQuery(document).ready(function() { $(".age").age(); }); </script>
Change log:
v1.2.0 (2014-05-24)
- added in support for removing certain units
v1.2.0 (2014-03-01)
- added in trim of extra spaces
v1.1.8 (2014-02-16)
- updating version with new floor changes and local gems
v1.1.6 (2013-11-18)
- fixing a bug around the interval not being used correctly
v1.1.5 (2013-10-31)
- fixing a bug for 'an hour' (was set to 'a hour' which is technically incorrect)
v1.1.4 (2013-10-22)
- updated to the latest version
v1.1.0 (2013-07-06)
- cleanup
v1.0.8 (2013-06-25)
- fixed a bug around years not showing up
This awesome jQuery plugin is developed by ksylvest. For more Advanced Usages, please check the demo page or visit the official website.