Skip to content

Commit 226b4c6

Browse files
committed
add created_at time
1 parent 25f4fb4 commit 226b4c6

File tree

8 files changed

+19
-15
lines changed

8 files changed

+19
-15
lines changed

lib/controller.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
var Inflector = require('inflected');
22
var tpl = require('tpl_apply');
3+
var moment = require('moment');
34

45
// movies_controller
56
function g(o) {
6-
7+
this.created_at = moment().format('MMMM Do YYYY, h:mm:ss a');
78
this.entity = Inflector.camelize(o.model.entity);
89
this.attrs = JSON.stringify(o.model.attr);
910
// console.log(o);

lib/model.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
var Inflector = require('inflected');
22
var tpl = require('tpl_apply');
3+
var moment = require('moment');
34

45
// movies_controller
56
function g(o) {
6-
7+
this.created_at = moment().format('MMMM Do YYYY, h:mm:ss a');
78
this.entity = Inflector.camelize(o.model.entity);
89
this.attrs = JSON.stringify(o.model.attr);
910
// console.log(o);

lib/route.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
var Inflector = require('inflected');
22
var tpl = require('tpl_apply');
3+
var moment = require('moment');
34

45
// movies_controller
56
function g(o) {
6-
7+
this.created_at = moment().format('MMMM Do YYYY, h:mm:ss a');
78
this.entity = Inflector.camelize(o.model.entity);
89
this.attrs = JSON.stringify(o.model.attr);
910
// console.log(o);

lib/route_api.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
var Inflector = require('inflected');
22
var tpl = require('tpl_apply');
3+
var moment = require('moment');
34

45
// movies_controller
56
function g(o) {
6-
7+
this.created_at = moment().format('MMMM Do YYYY, h:mm:ss a');
78
this.entity = Inflector.camelize(o.model.entity);
89
this.attrs = JSON.stringify(o.model.attr);
910
// console.log(o);

lib/view.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
var Inflector = require('inflected');
22
var tpl = require('tpl_apply');
33
var fs = require('fs');
4+
var moment = require('moment');
45

56
// movies_controller
67
function g(o) {
7-
8+
this.created_at = moment().format('MMMM Do YYYY, h:mm:ss a');
89
this.entity = Inflector.camelize(o.model.entity);
910
this.attrs = JSON.stringify(o.model.attr);
1011
this.model = o.model.entity;

package.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"scripts": {
77
"start": "npm publish .",
88
"test": "node test.js",
9-
"moag":"node bin/moag.js user name:string password:string uid:object",
10-
"moad":"node bin/moad.js user",
11-
"moan":"node bin/moan.js new_project"
9+
"moag": "node bin/moag.js user name:string password:string uid:object",
10+
"moad": "node bin/moad.js user",
11+
"moan": "node bin/moan.js new_project"
1212
},
1313
"preferGlobal": "true",
1414
"bin": {
@@ -29,10 +29,9 @@
2929
"dependencies": {
3030
"inflected": "^1.1.6",
3131
"mkdirp": "^0.5.1",
32-
"tpl_apply": "^1.0.2",
33-
"shelljs": "^0.5.0"
32+
"moment": "^2.10.3",
33+
"shelljs": "^0.5.0",
34+
"tpl_apply": "^1.0.2"
3435
},
35-
"devDependencies": {
36-
37-
}
36+
"devDependencies": {}
3837
}

tpl/controllers/controller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Created by Moajs on 01/06/2015.
2+
* Created by Moajs on {{created_at}}.
33
*/
44

55
var $models = require('mount-models');

tpl/models/movie.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Created by alfred on 01/06/14.
2+
* Created by alfred on {{created_at}}.
33
*/
44

55
var mongoose = require('mongoose');

0 commit comments

Comments
 (0)