Commit 3df4c22d authored by Johannes Bill's avatar Johannes Bill

added index.js for external usage

parent 1f8c86a1
......@@ -2,12 +2,13 @@ var dateArray = require('./lib/dateArray');
var dateView = require('./lib/dateView');
function getOHIndex(incl, excl, date, plz, cb) {
date = new Date(date.getFullYear(), date.getMonth(), date.getDate());
var epochSpan = [new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7),
new Date(date.getFullYear(), date.getMonth(), date.getDate() + 2)];
dateArray(epochSpan).getData([incl, excl], plz, function(err, result) {
if(err) return cb(err);
var fResult = result.filter(function(elem) {
return elem[0].getTime >= date.getTime();
return elem[0].getTime() >= date.getTime();
});
cb(null, fResult);
......
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