Skip to content

Commit aaa8d55

Browse files
authored
Merge pull request #210 from vim-jp/feature/2025/fix-timestamp
Asia/Tokyoのタイムスタンプに固定
2 parents 7ebbc46 + fcd4f6e commit aaa8d55

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

2025/src/components/Schedule/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ export const getScheduleCardStyle = (title: string) => {
1919
};
2020

2121
export const formatTime = (date: Date): string => {
22-
const hours = date.getHours().toString().padStart(2, "0");
23-
const minutes = date.getMinutes().toString().padStart(2, "0");
24-
return `${hours}:${minutes}`;
22+
return new Intl.DateTimeFormat("ja-JP", {
23+
timeZone: "Asia/Tokyo",
24+
hour: "2-digit",
25+
minute: "2-digit",
26+
hour12: false,
27+
}).format(date);
2528
};

0 commit comments

Comments
 (0)