blocks controller improved to find blocks by date
This commit is contained in:
parent
100b901581
commit
aa771bf4dd
|
@ -51,7 +51,13 @@ exports.list = function(req, res) {
|
|||
var findParam = {};
|
||||
|
||||
if (req.query.blockDate) {
|
||||
findParam = {};
|
||||
var gte = Math.round((new Date(req.query.blockDate)).getTime() / 1000);
|
||||
var lte = gte + 86400;
|
||||
|
||||
findParam = { time: {
|
||||
'$gte': gte,
|
||||
'$lte': lte
|
||||
}};
|
||||
}
|
||||
|
||||
Block
|
||||
|
@ -67,3 +73,14 @@ exports.list = function(req, res) {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
1296688602
|
||||
|
||||
|
||||
|
||||
1296615600
|
||||
|
||||
1296615600000
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue