Skip to content

Commit

Permalink
Merge pull request #74 from m1x0n/related-time
Browse files Browse the repository at this point in the history
related-time: Fixed templates
  • Loading branch information
m1x0n committed Aug 14, 2015
2 parents e8dd775 + 3ed7e1a commit b7fbc07
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions public/js/models/related-timestamps-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ define(['app', 'moment'], function(App, moment) {
App.RelatedTimestampsModel = Backbone.Model.extend({
attachLocalDates: function () {
var updatedRelative = moment.utc(this.get('updated_at')).toDate();
this.set('updated_local', moment(updatedRelative).fromNow());
this.set('updated_relative', moment(updatedRelative).fromNow());

var createdRelative = moment.utc(this.get('created_at')).toDate();
this.set('created_local', moment(createdRelative).fromNow());
this.set('created_relative', moment(createdRelative).fromNow());
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion public/js/views/templates/answer/single-answer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="votes"></div>

<!-- Text -->
<time>Answered at <%- created_local %></time>
<time>Answered <%- created_relative %></time>
<div class="description"><%= description %></div>

<!-- Comments -->
Expand Down
2 changes: 1 addition & 1 deletion public/js/views/templates/comment/single-comment.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="col-md-10">

<!-- Text -->
<time>Commented at <%- created_local %></time>
<time>Commented <%- created_relative %></time>
<p><%- text %></p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion public/js/views/templates/question/question-layout.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="row">
<!-- Time, title, folder -->
<div class="col-md-10">
<time>Asked at <%- created_local %></time>
<time>Asked <%- created_relative %></time>
<h2><%- title %></h2>
<div class="folder"><span class="icon glyphicon glyphicon-folder-open"></span> <%- folder.title %></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion public/js/views/templates/question/row.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="col-md-10">
<div class="row">
<div class="col-md-10 question-header">
<div class="asked_time">Asked at <%- created_local %></div>
<div class="asked_time">Asked <%- created_relative %></div>
<div><a class="question" href="#questions/<%- id %>"><b><%- title %></b></a></div>
<div class="folder">
<span class="icon glyphicon glyphicon-folder-close" aria-hidden="true"></span>
Expand Down

0 comments on commit b7fbc07

Please sign in to comment.