From acfeac27f4a8d62fad36605c2be4a1cd7aef3dd8 Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Fri, 7 Mar 2014 00:17:08 +0100 Subject: [PATCH] Added timestamps --- lib/models.js | 7 ++++--- package.json | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/lib/models.js b/lib/models.js index 06f8d889..6d6c001a 100644 --- a/lib/models.js +++ b/lib/models.js @@ -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: "" })); }; diff --git a/package.json b/package.json index 6755da51..a0b739a8 100644 --- a/package.json +++ b/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" } }