From 3f6153a7cf064fc3c93386f4e976c317ca7137c8 Mon Sep 17 00:00:00 2001 From: reality Date: Mon, 19 Jan 2015 22:19:34 +0000 Subject: [PATCH] order by int not string --- modules/report/commands.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/report/commands.js b/modules/report/commands.js index 5f0652d..d16fcbc 100644 --- a/modules/report/commands.js +++ b/modules/report/commands.js @@ -113,7 +113,9 @@ var commands = function(dbot) { if(quiet != 0 || warn != 0 || report != 0) { event.reply(user.primaryNick + ' has been warned ' + warn + ' times, quieted ' + quiet + ' times, and reported ' + report + ' times.'); - _.each(_.keys(items).sort(), function(time) { + _.each(_.keys(items).sort(function(a, b) { + return parseInt(a) - parseInt(b); + }), function(time) { event.reply('[' + moment(parseInt(time)).format('DD/MM/YYYY') + '] ' + items[time]); });