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

View File

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

View File

@ -8,8 +8,21 @@
<em>{{ range $i, $e := .Params.tags -}}{{- if $i -}}, {{ end -}}{{ . }}{{- end -}}</em> <em>{{ range $i, $e := .Params.tags -}}{{- if $i -}}, {{ end -}}{{ . }}{{- end -}}</em>
</td> </td>
<td class="align-right"> <td class="align-right">
{{ with .Params.start_date }}{{ time.Format "Jan 2006" . }}{{ end }} {{ with .Params.start_date }}
{{ with .Params.end_date }}{{ time.Format "Jan 2006" . }}{{ else }}{{ "Present" }}{{ end }} {{ 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> </td>
</tr> </tr>
</tbody> </tbody>