Commit 861eb58
Changed files (3)
badges
leap-day
badges/leap-day/leap-day.png
Binary file
badges/leap-day/leap-day.ts
@@ -0,0 +1,25 @@
+import { Commit, define, latest } from '#src'
+
+export default define({
+ url: import.meta.url,
+ badges: ['leap-day'] as const,
+ present(data, grant) {
+ const commits: Commit[] = []
+
+ for (const repo of data.repos) {
+ for (const commit of repo.commits) {
+ const data = new Date(commit.committedDate)
+ if (data.getMonth() === 1 && data.getDate() === 29) {
+ commits.push(commit)
+ }
+ }
+ }
+
+ if (commits.length > 0) {
+ grant(
+ 'leap-day',
+ 'Happy February 29th! I committed on a Leap Day!',
+ ).evidenceCommits(...commits.sort(latest).slice(0, 6))
+ }
+ },
+})
badges/index.ts
@@ -12,6 +12,7 @@ export default [
await import('./favorite-word/favorite-word.js'),
await import('./fix-commit/fix-commit.js'),
await import('./github-anniversary/github-anniversary.js'),
+ await import('./leap-day/leap-day.js'),
await import('./mass-delete-commit/mass-delete-commit.js'),
await import('./my-badges-contributor/my-badges-contributor.js'),
await import('./old-issue/old-issue.js'),