
$ npm install -g smart-time-ago
$('body').timeago();
<div class="timeLabels">
<time class="timeago" datetime="2012-07-18T07:51:50Z">about 8 hours ago</time>
<time class="timeago" datetime="2012-07-18T06:51:50Z">about 9 hours ago</time>
</div>
$('.timelabels').timeago();
$.fn.timeago.defaults = {
selector: 'time.timeago',
attr: 'datetime',
dir: 'up',
suffix: 'ago'
};
| 欢迎光临 冠富商务通中文社区 (http://gu1vhwx.nat.ipyingshe.com/news/) | Powered by Discuz! 3.0 |