Filter Block
Closed this issue · 2 comments
vinodsharmak commented
Hi,
Is it possible to filter blocks between two timestamps?
Thanks
monosux commented
Hi @vinodsharmak,
You can request two dates and go through all the blocks between them. Something like this:
const first_block = await dater.getDate('2022-09-15T06:00:00.000Z');
const last_block = await dater.getDate('2022-09-15T07:00:00.000Z', false);
let current_block = first_block.block;
while (current_block <= last_block.block) {
// do something with current_block
current_block++;
}
Is that what you needed?
vinodsharmak commented
Hello,
Yes. Thanks.
Thanks and Regards
…On Tue, 4 Oct, 2022, 11:05 pm Alexeev Sergey, ***@***.***> wrote:
Hi @vinodsharmak <https://github.com/vinodsharmak>,
You can request two dates and go through all the blocks between them.
Something like this:
const first_block = await dater.getDate('2022-09-15T06:00:00.000Z');
const last_block = await dater.getDate('2022-09-15T07:00:00.000Z', false);
let current_block = first_block.block;
while (current_block <= last_block.block) {
// do something with current_block
current_block++;
}
Is that what you needed?
—
Reply to this email directly, view it on GitHub
<#36 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AREETLMWK7VMSYZ2PVN5QJ3WBRTHPANCNFSM57DELXFQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>