jQuery Plugin For Human-Friendly Relative Time Formatting - tidyTime.js

File Size: 7.33KB
Views Total: 941
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin For Human-Friendly Relative Time Formatting - tidyTime.js

tidyTime.js is a plugin for jQuery that converts a regular time into a human friendly & readable time format such as 'It's a quarter past 3 in the afternoon and I'm feeling good!'

How to use it:

1. The html

<div class="tidyTime"></div>

2. Include jQuery library and jQuery tidyTime.js script on the page

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> 
<script type="text/javascript" src="tidyTime.min.js"></script> 

3. Initialization with some options

jQuery(document).ready(function($) {
$('.tidyTime').tidyTime({
time: '08:15', // The time that you would like to convert. 
before:'It\'s ', // prefix
after:' and I\'m feeling good!', // suffix
periodOfDay: true // set true to append the period of day to tidyTime. 
});
});

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