mirror of
https://github.com/flarum/framework.git
synced 2025-05-25 16:19:57 +08:00
Replace Ember app with Mithril app
This commit is contained in:
11
js/lib/helpers/human-time.js
Normal file
11
js/lib/helpers/human-time.js
Normal file
@ -0,0 +1,11 @@
|
||||
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);
|
||||
}
|
Reference in New Issue
Block a user