Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyv committed Sep 26, 2024
1 parent 985448d commit f021c8c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
1 change: 0 additions & 1 deletion .eslintcache

This file was deleted.

2 changes: 1 addition & 1 deletion components/GC.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang='ts' setup>
import type { ContributeData, Day, Weeks } from '~/types'
import { DEFAULT_WEEKDAY_LABELS, eachDayOfInterval, formatISO, getDayjsSubtract, getMonthLabels, groupByWeeks, sleep } from '~/utils'
import type { Label } from '~/utils'
import type { ContributeData, Day, Weeks } from '~/types'
const props = withDefaults(defineProps<{
username: string
Expand Down
2 changes: 1 addition & 1 deletion types/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Endpoints } from '@octokit/types'

export * from './gc'
export * from './article'
export * from './gc'

export type Repo = Endpoints['GET /user/repos']['response']['data'][number]
export type User = Endpoints['GET /user']['response']['data']
Expand Down
6 changes: 3 additions & 3 deletions uno.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'
import { parseColor } from '@unocss/preset-mini/utils'
import {
type CSSObject,
type RuleContext,
defineConfig,
type RuleContext,
} from 'unocss'
import { presetUseful } from 'unocss-preset-useful'
import { parseColor } from '@unocss/preset-mini/utils'
import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'

const typographyCssExtend: Record<string, CSSObject> = {
'a': {
Expand Down
7 changes: 6 additions & 1 deletion utils/gc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ export function groupByWeeks(days: Day[], weekStart: WeekDay = 0): Weeks {
const firstDate = parseISO(normalizedDays[0].date)
const firstCalendarDate = getDay(firstDate) === weekStart ? firstDate : subWeeks(nextDay(firstDate, weekStart), 1)

const paddedDays: Array<Day | undefined> = [...Array(differenceInCalendarDays(firstDate, firstCalendarDate)).fill(undefined), ...normalizedDays]
const paddedDays: Array<Day | undefined> = [
...Array.from({
length: differenceInCalendarDays(firstDate, firstCalendarDate),
}, () => undefined),
...normalizedDays,
]

return Array.from({ length: Math.ceil(paddedDays.length / 7) }, (_, i) => paddedDays.slice(i * 7, i * 7 + 7))
}
Expand Down
2 changes: 1 addition & 1 deletion utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './gc'
export * from './common'
export * from './gc'

0 comments on commit f021c8c

Please sign in to comment.