From 9e6ca915c304b08e60f6dfa453475045ef438736 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Tue, 1 Mar 2011 23:36:06 +0100 Subject: Fix sorting of the records in generated log. Now generates time sheet! --- lib/logger.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/logger.js b/lib/logger.js index faceca2..2b2d228 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -89,7 +89,13 @@ function timeSheetRecordsPrinter(records) { } } tmpArr.sort(function(a, b) { - return a[0] > b[0] ? 1 : -1; + if (a[0] > b[0]) { + return 1; + } else if (a[0] < b[0]) { + return -1; + } else { + return 0; + } }); var currentDay = ""; -- cgit