forked from zachleat/Humane-Dates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
34 lines (19 loc) · 894 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
A better way to display relative dates using JavaScript. Instead of a raw date
string, this script will return strings like "2 hours ago" or "5 days".
JavaScript Usage: (returns string)
humaneDate(new Date);
humaneDate('2008-01-28T20:24:17Z');
jQuery Plugin Usage: (sets HTML of elements)
<span class="humaneDate" title="2008-01-28T20:24:17Z">January 1, 2008 20:24:17 GMT</span>
$('span.humaneDate').humaneDates();
To run the full test suite:
ant install
ant
Copyright (c) 2008 Dean Landolt (deanlandolt.com)
Re-write by Zach Leatherman (zachleat.com)
Adopted from the John Resig's pretty.js
at http://ejohn.org/blog/javascript-pretty-date
and henrah's proposed modification
at http://ejohn.org/blog/javascript-pretty-date/#comment-297458
Licensed under the MIT license.
See more at http://www.zachleat.com/web/2008/03/23/yet-another-pretty-date-javascript/