From 5877449148d7e4aceeb6e2a809a78c90f61385c8 Mon Sep 17 00:00:00 2001 From: MM <14907823+MirMiz@users.noreply.github.com> Date: Sun, 23 Apr 2023 23:04:01 +0200 Subject: use dateFormat instead of .Date.Format --- layouts/issues/single.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/issues/single.html b/layouts/issues/single.html index 0dd8052..9aa135b 100644 --- a/layouts/issues/single.html +++ b/layouts/issues/single.html @@ -21,7 +21,7 @@

{{ T "lastChecked" }}: {{ if .Site.Params.dateFormat }} - {{ .Lastmod.Format .Site.Params.dateFormat }} + {{ dateFormat .Site.Params.dateFormat .Lastmod }} {{ else }} {{ .Lastmod.Format "January 2, 2006 at 3:04 PM" }} {{ end }} -- cgit v1.2.3-70-g09d2 From 9d0a4a7124589aa2cf9ed9c586d03ec1bf5406c7 Mon Sep 17 00:00:00 2001 From: MM <14907823+MirMiz@users.noreply.github.com> Date: Sun, 23 Apr 2023 23:04:40 +0200 Subject: use dateFormat instead of .Date.Format for better localization --- layouts/issues/issue.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/issues/issue.html b/layouts/issues/issue.html index 71bb30a..b7ec2ce 100644 --- a/layouts/issues/issue.html +++ b/layouts/issues/issue.html @@ -12,7 +12,7 @@ {{ if .Site.Params.dateFormat }} - {{ .Date.Format .Site.Params.dateFormat }} + {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }} -- cgit v1.2.3-70-g09d2 From fea94cf3390954ad25cc12104991193adddb2632 Mon Sep 17 00:00:00 2001 From: MM <14907823+MirMiz@users.noreply.github.com> Date: Sun, 23 Apr 2023 23:09:54 +0200 Subject: use dateFormat instead of .Date.Format for better localization --- layouts/issues/small.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/issues/small.html b/layouts/issues/small.html index 5eb3a2d..9c21cfb 100644 --- a/layouts/issues/small.html +++ b/layouts/issues/small.html @@ -10,7 +10,7 @@ {{ if .Site.Params.dateFormat }} - {{ .Date.Format .Site.Params.dateFormat }} + {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }} @@ -25,7 +25,7 @@ {{ else if .Params.Resolved }} {{ if .Site.Params.dateFormat }} - {{ .Date.Format .Site.Params.dateFormat }} + {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }} -- cgit v1.2.3-70-g09d2 From 510dbe065b267d49e64666b810b6d148ae26c41f Mon Sep 17 00:00:00 2001 From: MM <14907823+MirMiz@users.noreply.github.com> Date: Sun, 23 Apr 2023 23:36:34 +0200 Subject: added Dateformat localization to `relative-time` `relative-time` didn't respected the dateformat, but defaultet on UTC. The Title-Attribute (hover) now displays time in the chosen dateformat. an additional Attribut `data-date` contains the UTC-Format for calculating the relative times using JavaScript --- layouts/issues/small.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/layouts/issues/small.html b/layouts/issues/small.html index 9c21cfb..94fede3 100644 --- a/layouts/issues/small.html +++ b/layouts/issues/small.html @@ -8,7 +8,7 @@ {{ if .Params.informational }} - + {{ if .Site.Params.dateFormat }} {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} @@ -23,7 +23,7 @@ {{ else if .Params.Resolved }} - + {{ if .Site.Params.dateFormat }} {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} @@ -68,11 +68,11 @@ {{ else }} - + {{ if .Date.Before now }} {{ if .Site.Params.dateFormat }} - {{ .Date.Format .Site.Params.dateFormat }} + {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }} @@ -94,7 +94,7 @@ {{ T "downtimeOngoing" }} {{ else }} {{ if .Site.Params.dateFormat }} - {{ .Date.Format .Site.Params.dateFormat }} + {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }} -- cgit v1.2.3-70-g09d2 From 0671bb2dcdc6aea97e40bab2e8d709925c2b6471 Mon Sep 17 00:00:00 2001 From: MM <14907823+MirMiz@users.noreply.github.com> Date: Sun, 23 Apr 2023 23:37:50 +0200 Subject: changed reference to attribute which contins the date `relative-time` didn't respected the dateformat, but defaultet on UTC. The Title-Attribute (hover) now displays time in the chosen dateformat. an additional Attribut `data-date` contains the UTC-Format for calculating the relative times using JavaScript --- layouts/partials/js.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/js.html b/layouts/partials/js.html index 9e4dd9d..691b8dc 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -103,7 +103,7 @@ var elements = document.querySelectorAll('.relative-time'); for (var i = 0; i < elements.length; i++) { var element = elements[i]; - var time = Date.parse(element.getAttribute('title')); + var time = Date.parse(element.dataset.date); var html = element.getAttribute('data-time-prefix') || ''; -- cgit v1.2.3-70-g09d2