widget that will show some time ago in human readable format made as YUI3 module.
Based on jQuery widget.
HTML5 code like that:
Time: June 14th 2010 at 21:28
Time: June 13th 2010 at 11:21
<script type="text/javascript" src="timeago-min.js"></script>
And than
YUI().use('base', 'time-ago', function(Y) { var timeAgo = new Y.TimeAgo({ contentBox: "#content items time" }); timeAgo.startUpdates(); });
Result something like that:
Time: 20 minutes Time: 1 days
- Better inline documentation
- Internationalization of the messages.
- Cleanups
TimeAgo widget is released under the BSD License.
Copyright (c) 2010, Nazar Kulyk