SHOW:
|
|
- or go back to the newest paste.
1 | //Create models | |
2 | var blogPost = sequelize.define('blogPost', { | |
3 | title: Sequelize.STRING, | |
4 | content: Sequelize.TEXT | |
5 | }, { | |
6 | getterMethods : { | |
7 | - | postDate : function() { return this.post.dataValues.createdAt.getDate() + ' ' + this.post.dataValues.createdAt.getMonth()+1 +' '+ this.post.dataValues.createdAt.getFullYear() } |
7 | + | postDate : function() { |
8 | var months = ['...', ...]; | |
9 | return this.post.dataValues.createdAt.getDate() + ' ' + months[this.post.dataValues.createdAt.getMonth()] +' '+ this.post.dataValues.createdAt.getFullYear() | |
10 | } | |
11 | } | |
12 | }); |