Skip to content

Commit

Permalink
Use moment to parse incoming date created at
Browse files Browse the repository at this point in the history
  • Loading branch information
gdpelican committed Aug 18, 2015
1 parent b036074 commit be2e42a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 be2e42a

Please sign in to comment.