From fbbeebbdee7b80f8c4aa7a54e4a0009e09b63dc3 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 10 Jun 2015 13:59:25 +0930 Subject: [PATCH] Clean up, use time helper rather than util --- framework/core/js/forum/src/components/terminal-post.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/framework/core/js/forum/src/components/terminal-post.js b/framework/core/js/forum/src/components/terminal-post.js index da9fa00de..fdabecd6d 100644 --- a/framework/core/js/forum/src/components/terminal-post.js +++ b/framework/core/js/forum/src/components/terminal-post.js @@ -1,5 +1,5 @@ import Component from 'flarum/component'; -import humanTime from 'flarum/utils/human-time'; +import humanTime from 'flarum/helpers/human-time'; import username from 'flarum/helpers/username'; /** @@ -16,10 +16,13 @@ export default class TerminalPost extends Component { var discussion = this.props.discussion; var lastPost = this.props.lastPost && discussion.repliesCount(); + var user = discussion[lastPost ? 'lastUser' : 'startUser'](); + var time = discussion[lastPost ? 'lastTime' : 'startTime'](); + return m('span', [ - username(discussion[lastPost ? 'lastUser' : 'startUser']()), + username(user), lastPost ? ' replied ' : ' started ', - m('time', humanTime(discussion[lastPost ? 'lastTime' : 'startTime']())) + humanTime(time) ]) } }