diff --git a/src/layouts/components/FormattedDate.astro b/src/layouts/components/FormattedDate.astro index 0e514ac..e7293aa 100644 --- a/src/layouts/components/FormattedDate.astro +++ b/src/layouts/components/FormattedDate.astro @@ -1,20 +1,21 @@ --- interface Props { - date: Date; + date: Date; enableTime?: boolean; } const { date, enableTime } = Astro.props; +console.log(date); --- \ No newline at end of file + { + date.toLocaleDateString("ja-JP", { + year: "numeric", + month: "short", + day: "numeric", + hour: enableTime ? "numeric" : undefined, + minute: enableTime ? "numeric" : undefined, + }) + } +