use time.Format to localize date

This commit is contained in:
Julia Leblond 2024-08-19 16:10:24 +02:00
parent cbdc2a3f1d
commit bbca1dfce2
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@
</h2>
<footer class="article-time">
<time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
{{- time.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") .Date -}}
</time>
</footer>
</div>

View File

@ -32,7 +32,7 @@
<div>
{{ partial "helper/icon" "date" }}
<time class="article-time--published">
{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
{{- time.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") .Date -}}
</time>
</div>
{{ end }}