1
0

Add month abbreviation

This commit is contained in:
Serghei Cebotari 2023-12-03 23:00:02 +03:00
parent 8e3947478a
commit adcdbc9ba0
3 changed files with 45 additions and 6 deletions

View File

@ -11,8 +11,21 @@
<td><em>{{ with .Params.degree}}{{ . }}{{ end }}</em>
</td>
<td class="align-right"><em>
{{ with .Params.start_date }}{{ time.Format "Jan 2006" . }}{{ end }}
{{ with .Params.end_date }}{{ time.Format "Jan 2006" . }}{{ else }}{{ "Present" }}{{ end }}</em>
{{ 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 }}</em>
</td>
</tr>
{{ end }}

View File

@ -6,8 +6,21 @@
<tr>
<td><strong>{{ .Title }}</strong></td>
<td class="align-right">
{{ 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 }}
</td>
</tr>
<tr>

View File

@ -8,8 +8,21 @@
<em>{{ range $i, $e := .Params.tags -}}{{- if $i -}}, {{ end -}}{{ . }}{{- end -}}</em>
</td>
<td class="align-right">
{{ 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 }}
</td>
</tr>
</tbody>