From ec2417fc3e7029cb6fa84aa184daac2768ddad85 Mon Sep 17 00:00:00 2001 From: yyamashita Date: Sun, 10 May 2026 22:46:59 +0900 Subject: Separate current/former members with calculable period dates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add MemberGroup/BandGroup types and groupBandMembers/groupArtistMembers helpers - Calculate membership duration in months from YYYY-MM since/until values - Band view splits members into 在籍中 / 元メンバー sections with duration label - Artist view splits bands into 在籍中 / 元在籍 sections with duration label - Change since/until inputs to type="month" for structured data entry Co-Authored-By: Claude Sonnet 4.6 --- app/lib/utils.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/lib/utils.ts (limited to 'app/lib/utils.ts') diff --git a/app/lib/utils.ts b/app/lib/utils.ts new file mode 100644 index 0000000..961aa31 --- /dev/null +++ b/app/lib/utils.ts @@ -0,0 +1,7 @@ +export function formatDuration(months: number): string { + const years = Math.floor(months / 12); + const m = months % 12; + if (years === 0) return `${m}ヶ月`; + if (m === 0) return `${years}年`; + return `${years}年${m}ヶ月`; +} -- cgit v1.2.3