mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Use astro locale
This commit is contained in:
parent
8f5331b66a
commit
b81e933609
1 changed files with 2 additions and 4 deletions
|
|
@ -37,9 +37,7 @@ if (!album) {
|
||||||
Astro.response.statusText = 'Not found'
|
Astro.response.statusText = 'Not found'
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
const { currentLocale } = Astro
|
||||||
const locale =
|
|
||||||
navigator && navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
@ -74,7 +72,7 @@ const locale =
|
||||||
album.releaseDate ? (
|
album.releaseDate ? (
|
||||||
<tr>
|
<tr>
|
||||||
<th class='width-row'>{m.releaseDate()}</th>
|
<th class='width-row'>{m.releaseDate()}</th>
|
||||||
<ReleaseDate client:only='react' releaseDate={album.releaseDate} />
|
<td>{new Intl.DateTimeFormat(currentLocale, { dateStyle: 'medium' }).format(album.releaseDate)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue