Commit e68c951e authored by Johannes Bill's avatar Johannes Bill

added express test

parent 7de0ed18
...@@ -117,24 +117,6 @@ function cyclicFromTillDay(daySpan, noInMonth, timeSpan, dateSpan, epochSpan) { ...@@ -117,24 +117,6 @@ function cyclicFromTillDay(daySpan, noInMonth, timeSpan, dateSpan, epochSpan) {
return result; return result;
} }
/*function _cyclicFromTillDayOld(dayFrom, dayTill, noInMonth, timeFrom, timeUntil, epochStart, epochEnd) {
var firstDays = cyclic(dayFrom, noInMonth, timeFrom, timeUntil, epochStart, epochEnd);
var result = firstDays.slice();
for(var offset = 1; offset <= dayTill - dayFrom; offset++) {
for(var i = 0; i < firstDays.length; i++) {
var start = new Date(firstDays[i][0]);
var end = new Date(firstDays[i][1]);
start.setDate(start.getDate() + offset);
end.setDate(end.getDate() + offset);
if(end <= epochEnd)
result.push([start, end]);
}
}
sort(result);
return result;
}*/
function _getNextNoInMonthOccurence(day, startDate, noInMonth) { function _getNextNoInMonthOccurence(day, startDate, noInMonth) {
startDate = new Date(startDate); startDate = new Date(startDate);
......
...@@ -6,7 +6,7 @@ router.get('/', function(req, res) { ...@@ -6,7 +6,7 @@ router.get('/', function(req, res) {
var time0 = process.hrtime(); var time0 = process.hrtime();
var dateString = req.query.date; var dateString = req.query.date;
var now; var now;
if(dateString.length == 8) { if(dateString && dateString.length == 8) {
var year = parseInt(dateString.slice(0,4)); var year = parseInt(dateString.slice(0,4));
var month = parseInt(dateString.slice(4,6)); var month = parseInt(dateString.slice(4,6));
var date = parseInt(dateString.slice(6,8)); var date = parseInt(dateString.slice(6,8));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment