Reputation: 191
I have an query sorting by timestamp, and I need to see only the data within last week
so I did
.dbRef
.where('regTime', '>', new Date( -7 * 24 * 60 * 60 * 1000)
but somehow not filtered by correct results.
anyone knows why?
Upvotes: 0
Views: 106
Reputation: 191
seem to be less interesting / active programmers or people who like to help in react native, so for future searchers:
let weekAgo = new Date();
let weekInMilliseconds = -7 * 24 * 60 * 60 * 1000;
weekAgo.setTime(weekAgo.getTime() + weekInMilliseconds);
Upvotes: 1