diff --git a/.gitignore b/.gitignore index db5c4cc7..7b769d1b 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,4 @@ lab/output/ # opensrc - source code for packages opensrc/ +AGENTS.md diff --git a/CLAUDE.md b/CLAUDE.md index a47fd83c..f0404d2e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -125,6 +125,14 @@ Types are generated to `app/services/type.ts` from the database. **CamelCasePlugin と `sql` テンプレート**: `sql` テンプレートリテラル内の識別子は CamelCasePlugin で変換されない。`sql` 内でカラムを参照するときは `sql.ref('tableName.columnName')` を使うこと。 +### 日時・タイムゾーンの原則 + +- **DB 保存形式**: ISO 8601(`2026-03-16T02:56:35Z`)。Z付きで保存し、ローカルタイム形式(`2026-03-16 02:56:35`)は使わない +- **DB から読んだ日時のパース**: 必ず `dayjs.utc(value)` を使う。`dayjs(value)` はローカルタイムとして解釈されるため、タイムゾーン変換が正しく動かない +- **表示層でのタイムゾーン変換**: `dayjs.utc(value).tz(timezone)` のパターンを使う +- **batch での書き込み**: GitHub API から取得した ISO 8601 文字列をそのまま DB に保存する。独自のフォーマット変換をかけない +- **`timeFormatTz`**(`batch/helper/timeformat.ts`): レポートやスプレッドシート出力用。内部で `dayjs.utc()` を使用済み + ### Path Aliases Use `~/` prefix for imports from `app/` directory: @@ -218,7 +226,7 @@ Org-scoped tables (have `organizationId` column): `companyGithubUsers`, `exportS ### Source Code Reference -Source code for dependencies is available in `opensrc/` for deeper understanding of implementation details. See `opensrc/sources.json` for the list of available packages. +Source code for dependencies is available in `opensrc/` for deeper understanding of implementation details. See `opensrc/sources.json` for the list of available packages and their versions. Use this source code when you need to understand how a package works internally, not just its types/interface. ```bash npx opensrc # npm package (e.g., npx opensrc zod) diff --git a/app/components/size-badge-popover.tsx b/app/components/size-badge-popover.tsx index 0c909422..51aa7943 100644 --- a/app/components/size-badge-popover.tsx +++ b/app/components/size-badge-popover.tsx @@ -242,7 +242,7 @@ export function SizeBadgePopover({ )} - {feedbackName} · {dayjs(feedbackAt).fromNow()} + {feedbackName} · {dayjs.utc(feedbackAt).fromNow()} )}