/* jshint indent: 2 */
+var moment = require('moment');
module.exports = function(sequelize, DataTypes) {
var VoiceVoicemailMessages = sequelize.define('VoiceVoicemailMessages', {
stamp: {
type: 'TIMESTAMP',
allowNull: false
+ },
+ createdAt: {
+ type: DataTypes.DATE,
+ defaultValue: sequelize.fn('NOW'),
+ get: function() {
+ // 'this' allows you to access attributes of the instance
+ return moment(this.getDataValue('createdAt')).format("MM-DD-YYYY HH:mm").toString();
+ }
+ },
+ updatedAt: {
+ type: DataTypes.DATE,
+ defaultValue: sequelize.fn('NOW'),
+ get: function() {
+ // 'this' allows you to access attributes of the instance
+ return moment(this.getDataValue('updatedAt')).format("MM-DD-YYYY HH:mm").toString();
+ }
}
}, {
tableName: 'voice_voicemail_messages',