Added timestamps

This commit is contained in:
Mattias Erming 2014-03-07 00:17:08 +01:00
parent ccba766dbe
commit acfeac27f4
2 changed files with 19 additions and 4 deletions

View file

@ -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: ""
}));
};

View file

@ -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"
}
}