Added timestamps
This commit is contained in:
parent
ccba766dbe
commit
acfeac27f4
|
@ -1,4 +1,5 @@
|
|||
var _ = require("lodash");
|
||||
var moment = require("moment");
|
||||
|
||||
var models = exports;
|
||||
var id = 0;
|
||||
|
@ -40,9 +41,9 @@ models.User = function(attr) {
|
|||
models.Message = function(attr) {
|
||||
attr = attr || {};
|
||||
_.extend(this, _.defaults(attr, {
|
||||
text: "",
|
||||
time: "",
|
||||
user: ""
|
||||
time: moment().format("HH:mm"),
|
||||
user: "",
|
||||
text: ""
|
||||
}));
|
||||
};
|
||||
|
||||
|
|
16
package.json
16
package.json
|
@ -1,14 +1,28 @@
|
|||
{
|
||||
"name": "chat",
|
||||
"description": "A web-based client/server IRC chat",
|
||||
"author": {
|
||||
"name": "Mattias Erming",
|
||||
"email": "mattias@mattiaserming.com"
|
||||
},
|
||||
"description": "A web-based client/server IRC chat",
|
||||
"dependencies": {
|
||||
"commander": "2.1.0",
|
||||
"connect": "2.13.0",
|
||||
"irc": "0.3.6",
|
||||
"lodash": "2.4.1",
|
||||
"moment": "2.5.1",
|
||||
"socket.io": "0.9.16"
|
||||
},
|
||||
"keywords": [
|
||||
"chat",
|
||||
"irc",
|
||||
"server",
|
||||
"web",
|
||||
"browser"
|
||||
],
|
||||
"main": "./app.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/erming/chat.git"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue