Built motion from commit 945d615.|1.0.13
[motion.git] / server / models / voice_voicemail_messages.js
index fbfc691..b9df0a6 100644 (file)
@@ -1,4 +1,5 @@
 /* jshint indent: 2 */
+var moment = require('moment');
 
 module.exports = function(sequelize, DataTypes) {
   var VoiceVoicemailMessages = sequelize.define('VoiceVoicemailMessages', {
@@ -54,6 +55,22 @@ module.exports = function(sequelize, DataTypes) {
     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',