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> </h2>
<footer class="article-time"> <footer class="article-time">
<time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'> <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> </time>
</footer> </footer>
</div> </div>

View File

@ -32,7 +32,7 @@
<div> <div>
{{ partial "helper/icon" "date" }} {{ partial "helper/icon" "date" }}
<time class="article-time--published"> <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> </time>
</div> </div>
{{ end }} {{ end }}