mirror of
https://github.com/tachiyomiorg/website.git
synced 2024-12-20 23:22:00 +01:00
Fix news dates. (#1040)
This commit is contained in:
parent
fbdc4d5e5b
commit
c3ba9022cf
@ -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)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -23,7 +32,7 @@ const dateFormatter = new Intl.DateTimeFormat("en", {
|
||||
<div class="background" />
|
||||
</h3>
|
||||
<time :datetime="news.date">
|
||||
{{ dateFormatter.format(new Date(news.date)) }}
|
||||
{{ formatDate(news.date) }}
|
||||
</time>
|
||||
</div>
|
||||
<p>{{ news.description }}</p>
|
||||
|
@ -2,7 +2,7 @@
|
||||
type: article
|
||||
title: Updated website
|
||||
description: We've got a fresh new website we hope will be even easier to use
|
||||
date: 2023-09-09
|
||||
date: 2023-09-10
|
||||
---
|
||||
|
||||
# Updated website
|
Loading…
Reference in New Issue
Block a user