framework/js/lib/helpers/human-time.js

12 lines
309 B
JavaScript
Raw Normal View History

2015-04-25 20:58:39 +08:00
import humanTime from 'flarum/utils/human-time';
export default function humanTimeHelper(time) {
var time = moment(time);
var datetime = time.format();
var full = time.format('LLLL');
var ago = humanTime(time);
return m('time', {pubdate: '', datetime, title: full, 'data-humantime': ''}, ago);
}