feat(badges): implement daily, weekly, monthly badge support#61
feat(badges): implement daily, weekly, monthly badge support#61doubledare704 wants to merge 2 commits intopinchbench:mainfrom
Conversation
|
@doubledare704 is attempting to deploy a commit to the Kilo Code Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Love this idea @doubledare704 thanks for it
in the deploy i'm seeing these errors
Do you see those locally? |
Haven't seen during local dev run. Will keep looking for it, and rebase branch to be able to merge. |
|
@doubledare704 1d → 24-hour sliding window (not "today") 7d → 7×24h sliding window (not "this week") 30d → 30×24h sliding window (not "this month") Example for 1d: if you hold #1 at 23:59 UTC, your badge can expire ~1 minute later when the window slides. No calendar boundary is used anywhere — durationMs is just arithmetic: 24 * 60 * 60 * 1000. Suggestion: Replace the durationMs arithmetic with UTC calendar boundaries — e.g. for 1d, use the start of the current UTC day; for 7d, the start of the current UTC week (Monday); for 30d, the first day of the current UTC month. Or if a rolling window is intentional, consider renaming labels to "24H 7D 30D" to set correct expectations. |
- Extend badge calculation logic in `lib/badges.ts` for daily, weekly, monthly periods - Add API route handlers for badge endpoints (`/daily`, `/weekly`, `/monthly`) - Update submission page and UI components to render the new badges - Add unit tests covering the new badge functionality
a64733a to
6d8e8c4
Compare
|
@olearycrew @NianJiuZst added changes to fix both mentioned parts |


lib/badges.tsfor daily, weekly, monthly periods/daily,/weekly,/monthly)Implements Daily, weekly, monthly badges #48