diff --git a/layouts/events/single.html b/layouts/events/single.html index 76047c1db..9369c6a0e 100644 --- a/layouts/events/single.html +++ b/layouts/events/single.html @@ -12,7 +12,7 @@

Future

{{- $.Scratch.Set "close-tag" "false" -}} {{- range sort $.Site.Data.events "startdate" -}} {{- if .startdate -}} - {{- if ge (dateFormat "2006-01-02" .enddate) (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) -}} + {{- if ge (time .enddate) now -}} {{- if ne ($.Scratch.Get "year") (dateFormat "2006" .startdate) -}} {{- $.Scratch.Set "year" (dateFormat "2006" .startdate) -}} {{- $.Scratch.Set "year-displayed" "false" -}} @@ -31,7 +31,7 @@

{{ dateFormat "January" .startdate }}

{{- $.Scratch.Set "close-tag" "true" -}} {{- end -}} {{- if ne .startdate .enddate }} - {{- if eq (dateFormat "January" .startdate) (dateFormat "January" .enddate ) -}} + {{- if eq (time .startdate).Month (time .enddate).Month -}} {{ dateFormat "Jan 2" .startdate }} - {{ dateFormat "2" .enddate }}: {{ .city }} diff --git a/layouts/index.html b/layouts/index.html index 536f28f6c..b255eaa3f 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -6,7 +6,7 @@
{{- range sort $.Site.Data.events "startdate" -}} {{- if .startdate -}} - {{- if ge (dateFormat "2006-01-02" .enddate) (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) -}} + {{- if ge (time .enddate) now -}} {{- $.Scratch.Set "city" .city -}} {{- $.Scratch.Set "year" .year -}} {{- $.Scratch.Set "logo" "unset" -}} @@ -24,7 +24,7 @@ {{- end -}}
{{- if ne .startdate .enddate -}} - {{- if eq (dateFormat "January" .startdate) (dateFormat "January" .enddate ) -}} + {{- if eq (time .startdate).Month (time .enddate).Month -}} {{ dateFormat "Jan 2" .startdate }} - {{ dateFormat "2, 2006" .enddate }}
diff --git a/layouts/partials/events/cta.html b/layouts/partials/events/cta.html index c06483627..fd47e153d 100644 --- a/layouts/partials/events/cta.html +++ b/layouts/partials/events/cta.html @@ -21,7 +21,7 @@ {{- else -}} {{- if $e.startdate -}} {{- if $e.registration_date_start -}} - {{- if and (ge (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) (dateFormat "2006-01-02" $e.registration_date_start)) (le (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) (dateFormat "2006-01-02" $e.registration_date_end)) -}} + {{- if and (ge now (time $e.registration_date_start)) (le now (time $e.registration_date_end)) -}} {{- if $e.registration_link -}} {{- if eq $e.registration_link "" -}} {{- $.Scratch.Set "registration_link" ((printf "/events/%s/registration" $e.name) | absURL ) -}} diff --git a/layouts/partials/future.html b/layouts/partials/future.html index 1baa73f06..f4afe49c0 100644 --- a/layouts/partials/future.html +++ b/layouts/partials/future.html @@ -1,6 +1,6 @@ {{- range sort $.Site.Data.events "startdate" -}} {{- if .startdate -}} - {{- if ge (dateFormat "2006-01-02" .enddate) (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) -}} + {{- if ge (time .enddate) now -}} {{- if ne ($.Scratch.Get "year") (dateFormat "2006" .startdate) -}} {{- $.Scratch.Set "year" (dateFormat "2006" .startdate) -}} {{- $.Scratch.Set "year-displayed" "false" -}} @@ -19,7 +19,7 @@

{{ dateFormat "January" .startdate }}

{{- $.Scratch.Set "month-displayed" "true" -}} {{- end -}} {{- if ne .startdate .enddate }} - {{- if eq (dateFormat "January" .startdate) (dateFormat "January" .enddate ) -}} + {{- if eq (time .startdate).Month (time .enddate).Month -}}
{{ dateFormat "Jan 2" .startdate }} - {{ dateFormat "2" .enddate }}: {{ .city }} diff --git a/layouts/partials/map.html b/layouts/partials/map.html index e6dace270..5fa10b0ff 100644 --- a/layouts/partials/map.html +++ b/layouts/partials/map.html @@ -21,10 +21,10 @@ {{ if .startdate }} // if the startdate is today or in the future - {{ if ge (dateFormat "2006-01-02" .enddate) (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) }} + {{ if ge (time .enddate) now }} // if the startdate month and enddate month are different, show both months - {{ if ne (dateFormat "Jan" .startdate) (dateFormat "Jan" .enddate) }} + {{ if ne (time .startdate).Month (time .enddate).Month }} ['{{ .city}}', {{ .coordinates | safeJS }}, '{{ dateFormat "Jan 2" .startdate }}-{{ dateFormat "Jan 2" .enddate }}', '/events/{{ .name }}'], {{ else }} diff --git a/layouts/section/events.rss.xml b/layouts/section/events.rss.xml index bb9b53551..2dc133746 100644 --- a/layouts/section/events.rss.xml +++ b/layouts/section/events.rss.xml @@ -20,7 +20,7 @@ Hugo -- gohugo.io {{- range sort $.Site.Data.events "startdate" -}} {{- if .startdate -}} - {{- if ge (dateFormat "2006-01-02" .enddate) (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) -}} + {{- if ge (time .enddate) now -}} {{- if eq .startdate .enddate -}} devopsdays {{ .city }} {{ .year }} is coming! {{ dateFormat "Monday, January 2, 2006" .startdate }} diff --git a/layouts/section/speaking.rss.xml b/layouts/section/speaking.rss.xml index 42e5494d4..fa6dc00a2 100644 --- a/layouts/section/speaking.rss.xml +++ b/layouts/section/speaking.rss.xml @@ -20,9 +20,9 @@ Hugo -- gohugo.io {{- range sort $.Site.Data.events "startdate" -}} {{- if .startdate -}} - {{- if ge (dateFormat "2006-01-02" .enddate) (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) -}} + {{- if ge (time .enddate) now -}} {{ if .cfp_date_end }} - {{ if ge (dateFormat "2006-01-02" .cfp_date_end) (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) }} + {{ if ge (time .cfp_date_end) now }} devopsdays {{ .city }} {{ .year }} {{ (printf "events/%s" .name) | absURL }}