We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cdd3991 commit ca514c2Copy full SHA for ca514c2
packages/ponder/src/api/index.ts
@@ -8,7 +8,7 @@ ponder.get("/stats", async (c) => {
8
const usersCount = await c.db.select({ value: count() }).from(c.tables.User);
9
const challengesCount = await c.db.select({ value: count() }).from(c.tables.Challenge);
10
11
- const lastMonth = (Date.now() - (30 * 24 * 60 * 60 * 1000)) / 1000;
+ const lastMonth = Math.floor(Date.now() / 1000) - (30 * 24 * 60 * 60);
12
13
const usersCountLastMonth = await c.db.select({ value: count() }).from(c.tables.User).where(gte(c.tables.User.updated, lastMonth));
14
const challengesCountLastMonth = await c.db.select({ value: count() }).from(c.tables.Challenge).where(gte(c.tables.Challenge.timestamp, lastMonth));
0 commit comments