From adcdbc9ba085e126e309d7dec50fb80e5e2ec3bc Mon Sep 17 00:00:00 2001 From: Serghei Cebotari Date: Sun, 3 Dec 2023 23:00:02 +0300 Subject: [PATCH] Add month abbreviation --- layouts/partials/sections/education.html | 17 +++++++++++++++-- layouts/partials/sections/experience.html | 17 +++++++++++++++-- layouts/partials/sections/projects.html | 17 +++++++++++++++-- 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/layouts/partials/sections/education.html b/layouts/partials/sections/education.html index 4ea693d..36a30c7 100644 --- a/layouts/partials/sections/education.html +++ b/layouts/partials/sections/education.html @@ -11,8 +11,21 @@ {{ with .Params.degree}}{{ . }}{{ end }} - {{ with .Params.start_date }}{{ time.Format "Jan 2006" . }}{{ end }} – - {{ with .Params.end_date }}{{ time.Format "Jan 2006" . }}{{ else }}{{ "Present" }}{{ end }} + {{ with .Params.start_date }} + {{ if le ( len (time.Format "January" .)) 4}} + {{ time.Format "January 2006" . }} + {{ else }} + {{ time.Format "Jan. 2006" . }} + {{ end }} + {{ end }} – + {{ with .Params.end_date }} + {{ if le ( len (time.Format "January" .)) 4}} + {{ time.Format "January 2006" . }} + {{ else }} + {{ time.Format "Jan. 2006" . }} + {{ end }} + {{ else }}{{ "Present" }} + {{ end }} {{ end }} diff --git a/layouts/partials/sections/experience.html b/layouts/partials/sections/experience.html index f813a54..5991c8a 100644 --- a/layouts/partials/sections/experience.html +++ b/layouts/partials/sections/experience.html @@ -6,8 +6,21 @@ {{ .Title }} - {{ with .Params.start_date }}{{ time.Format "Jan 2006" . }}{{ end }} – - {{ with .Params.end_date }}{{ time.Format "Jan 2006" . }}{{ else }}{{ "Present" }}{{ end }} + {{ with .Params.start_date }} + {{ if le ( len (time.Format "January" .)) 4}} + {{ time.Format "January 2006" . }} + {{ else }} + {{ time.Format "Jan. 2006" . }} + {{ end }} + {{ end }} – + {{ with .Params.end_date }} + {{ if le ( len (time.Format "January" .)) 4}} + {{ time.Format "January 2006" . }} + {{ else }} + {{ time.Format "Jan. 2006" . }} + {{ end }} + {{ else }}{{ "Present" }} + {{ end }} diff --git a/layouts/partials/sections/projects.html b/layouts/partials/sections/projects.html index fb0026c..75289ea 100644 --- a/layouts/partials/sections/projects.html +++ b/layouts/partials/sections/projects.html @@ -8,8 +8,21 @@ {{ range $i, $e := .Params.tags -}}{{- if $i -}}, {{ end -}}{{ . }}{{- end -}} - {{ with .Params.start_date }}{{ time.Format "Jan 2006" . }}{{ end }} – - {{ with .Params.end_date }}{{ time.Format "Jan 2006" . }}{{ else }}{{ "Present" }}{{ end }} + {{ with .Params.start_date }} + {{ if le ( len (time.Format "January" .)) 4}} + {{ time.Format "January 2006" . }} + {{ else }} + {{ time.Format "Jan. 2006" . }} + {{ end }} + {{ end }} – + {{ with .Params.end_date }} + {{ if le ( len (time.Format "January" .)) 4}} + {{ time.Format "January 2006" . }} + {{ else }} + {{ time.Format "Jan. 2006" . }} + {{ end }} + {{ else }}{{ "Present" }} + {{ end }}