Skip to content

Commit 4b5ef06

Browse files
committed
Merge pull request #191 from devopsdays/mattstratton/fix-null-dates
Fix to allow for empty start, end, and cfp dates Former-commit-id: 31d5d76
2 parents e6ddb05 + 31744fb commit 4b5ef06

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

layouts/shortcodes/cfp_dates.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
{{ $event_slug := index $path 1 }}
33
{{ $e := (index .Page.Site.Data.events $event_slug) }}
44

5-
{{ if isset $e "cfp_date_start" }}
5+
{{ if and ($e.cfp_date_start) ($e.cfp_date_end) ($e.cfp_date_announce)}}
66

77
{{ $cfp_date_start := $e.cfp_date_start }}
88
{{ $cfp_date_end := $e.cfp_date_end }}
99
{{ $cfp_date_announce := $e.cfp_date_announce }}
1010

11-
12-
1311
<center>
1412
<b>Call for proposals opens {{ dateFormat "Monday, Jan 2, 2006" $cfp_date_start }}.</b><br>
1513
<b>Call for proposals closes {{ dateFormat "Monday, Jan 2, 2006" $cfp_date_end }}.</b><br>
1614
Selected proposals will be announced on {{ dateFormat "Monday, Jan 2, 2006" $cfp_date_announce }}.
1715
</center>
16+
{{ else }}
17+
<center>
18+
<b>Call for proposals is TBD</b>
19+
</center>
1820
{{ end }}

layouts/shortcodes/event_end.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
{{ $e := (index .Page.Site.Data.events $event_slug) }}
44
{{ $enddate := $e.enddate}}
55

6-
{{ if isset $e "enddate" }}
6+
{{ if $e.enddate }}
7+
{{ $enddate := $e.enddate}}
78
{{ dateFormat "Monday, Jan 2, 2006" $enddate }}
89
{{ else }}
910
TBD

layouts/shortcodes/event_start.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
{{ $event_slug := index $path 1 }}
33
{{ $e := (index .Page.Site.Data.events $event_slug) }}
44

5-
{{ $startdate := $e.startdate}}
6-
7-
{{ if isset $e "startdate" }}
5+
{{ if $e.startdate }}
6+
{{ $startdate := $e.startdate}}
87
{{ dateFormat "Monday, Jan 2, 2006" $startdate }}
98
{{ else }}
109
TBD

0 commit comments

Comments
 (0)