diaspora/public/javascripts/app/models/post.js

11 lines
262 B
JavaScript

App.Models.Post = Backbone.Model.extend({
url: "/posts",
initialize: function() {
this.comments = new App.Collections.Comments(this.get("last_three_comments"));
},
createdAt: function(){
return +new Date(this.get("created_at")) / 1000;
}
});