mirror of
https://github.com/tachiyomiorg/website.git
synced 2024-12-21 07:31:58 +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",
|
dateStyle: "medium",
|
||||||
timeZone: "UTC",
|
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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -23,7 +32,7 @@ const dateFormatter = new Intl.DateTimeFormat("en", {
|
|||||||
<div class="background" />
|
<div class="background" />
|
||||||
</h3>
|
</h3>
|
||||||
<time :datetime="news.date">
|
<time :datetime="news.date">
|
||||||
{{ dateFormatter.format(new Date(news.date)) }}
|
{{ formatDate(news.date) }}
|
||||||
</time>
|
</time>
|
||||||
</div>
|
</div>
|
||||||
<p>{{ news.description }}</p>
|
<p>{{ news.description }}</p>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
type: article
|
type: article
|
||||||
title: Updated website
|
title: Updated website
|
||||||
description: We've got a fresh new website we hope will be even easier to use
|
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
|
# Updated website
|
Loading…
Reference in New Issue
Block a user