diff --git a/website/src/.vitepress/theme/components/News.vue b/website/src/.vitepress/theme/components/News.vue index 28f3302f..fddc8b09 100644 --- a/website/src/.vitepress/theme/components/News.vue +++ b/website/src/.vitepress/theme/components/News.vue @@ -6,6 +6,15 @@ const dateFormatter = new Intl.DateTimeFormat("en", { dateStyle: "medium", timeZone: "UTC", }) + +function formatDate(date: string) { + const [year, month, day] = date + .substring(0, 10) + .split("-") + .map((number) => Number.parseInt(number, 10)) + const utcDate = Date.UTC(year, month - 1, day) + return dateFormatter.format(utcDate) +}