-
-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: activity widget #8628
feat: activity widget #8628
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
|
||
type Output = { date: string; count: number; level: number }; | ||
|
||
export function transformData(inputData: ProjectActivitySchema): Output[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be cleaned up later, but basically for each day we need a level(color), and this divides them evenly into level buckets.
|
||
// Step 1: Count the occurrences of each date | ||
inputData.forEach((item) => { | ||
const formattedDate = new Date(item.date).toISOString().split('T')[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't they already formatted this way?
But anyway, this is just an accumulation, right? Assuming we have multiple entries for each date, it'll count each entry as one and sum them together?
Maybe I've misunderstood the API, but I thought we returned each date only once, with already summed up activities? In that case, this'd be wrong, right?
It is still raw, next PRs add styling and date filtering for only single year.