aboutsummaryrefslogtreecommitdiffstats
path: root/lib/logger.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/logger.js')
-rw-r--r--lib/logger.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/logger.js b/lib/logger.js
index 19fabb5..7e0c516 100644
--- a/lib/logger.js
+++ b/lib/logger.js
@@ -79,13 +79,25 @@ exports.generateTimeSheet = function generateTimeSheet() {
};
function timeSheetRecordsPrinter(records) {
+ function leadingZero(n) {
+ // pads a single number with a leading zero. Heh.
+ var s = n.toString();
+ if (s.length === 1) {
+ s = "0" + s;
+ }
+ return s;
+ }
+
var commentBugRE = new RegExp("[bB]ug\\s+([0-9]+)","g");
// sort the records into temporary array
var tmpArr = [];
+ var today = new Date();
+ var todayStr = today.getFullYear()+"-"+leadingZero(today.getMonth()+1)+
+ "-"+leadingZero(today.getDate());
var outStr = '<!DOCTYPE html>' +
"<html><head>\n"+
"<meta charset='utf-8'/>\n"+
- "<title>Status report</title>\n</head>\n<body>\n" +
+ "<title>TimeSheet-"+ todayStr + "</title>\n</head>\n<body>\n" +
"<h1>TimeSheet</h1>\n";
for (var i in records) {