/**
* tag Model
*/
+var moment = require('moment');
module.exports = function(sequelize, DataTypes) {
name: DataTypes.STRING,
output: DataTypes.STRING, //csv,pdf,..
savename: DataTypes.STRING,
- startDate: DataTypes.DATE,
- endDate: DataTypes.DATE,
+ startDate: {
+ type: DataTypes.DATE,
+ get: function() {
+ // 'this' allows you to access attributes of the instance
+ return moment(this.getDataValue('startDate')).format("DD-MM-YYYY").toString();
+ }
+ },
+ endDate: {
+ type: DataTypes.DATE,
+ get: function() {
+ // 'this' allows you to access attributes of the instance
+ return moment(this.getDataValue('endDate')).format("DD-MM-YYYY").toString();
+ }
+ },
status: {
type: DataTypes.STRING,
defaultValue: 'Loading'
- }
+ },
+ createdAt: {
+ type: DataTypes.DATE,
+ get: function() {
+ // 'this' allows you to access attributes of the instance
+ return moment(this.getDataValue('createdAt')).format("DD-MM-YYYY").toString();
+ }
+ },
}, {
tableName: 'analytics_extracted_reports',
// associate: function(models) {