Skip to content

Commit

Permalink
Merge pull request #23 from gdpelican/fix-date-diff
Browse files Browse the repository at this point in the history
Use moment to parse incoming date created at
  • Loading branch information
gdpelican committed Aug 18, 2015
2 parents b036074 + be2e42a commit f65d6e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Expand Up @@ -25,6 +25,7 @@ export default Ember.Component.extend({
messageBus.subscribe('/babble/post', function(data) {
var postStream = self.get('topic.postStream')
var post = postStream.storePost(Discourse.Post.create(data))
post.created_at = moment(data.created_at, 'YYYY-MM-DD HH:mm:ss Z')
postStream.appendPost(post)

var scrolledToBottom = self.isElementScrolledToBottom(self.get('scrollContainer'))
Expand Down
2 changes: 1 addition & 1 deletion plugin.rb
Expand Up @@ -101,7 +101,7 @@ def trigger_after_events(post)
TopicUser.update_last_read(@user, @topic.id, @post.post_number, PostTiming::MAX_READ_TIME_PER_BATCH)

MessageBus.publish "/babble/topic", serialized_topic
MessageBus.publish "/babble/post", serialized_post.merge!(type: :created)
MessageBus.publish "/babble/post", serialized_post
end

private
Expand Down

0 comments on commit f65d6e4

Please sign in to comment.