Skip to content
This repository was archived by the owner on Jul 21, 2019. It is now read-only.

Commit 3394395

Browse files
Merge pull request #641 from tgross/what_are_even_timezones
updates CFP OPEN footer to use time comparisons
2 parents 3952c01 + f9501fe commit 3394395

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

REFERENCE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ The YYYY-CITY.yml file is the main configuration file for your event. This is wh
4545
| `speakers_verbose` | String | No | Set this to "true" if you want verbose speaker attributes (URLs visible). | "true" |
4646

4747
### Date-related Fields
48-
All dates are in unquoted YYYY-MM-DD, like this: `variable: 2016-01-05`
48+
All dates are in unquoted YYYY-MM-DD, like this: `variable: 2016-01-05`, or like `variable: 2016-01-05T23:59:00-06:00`
4949

5050
| Field Name | Type | Required | Description | Example |
5151
|-------------------------|------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|
5252
| `startdate` | YYYY-MM-DD | No | The start date of your event. Leave blank if you don't have a venue reserved yet. | 2016-01-05 |
5353
| `enddate` | YYYY-MM-DD | No | The end date of your event. Leave blank if you don't have a venue reserved yet. | 2016-01-05 |
5454
| `cfp_date_start` | YYYY-MM-DD | No | The date you will start accepting talk proposals. Can be a blank value. | 2016-01-05 |
55-
| `cfp_date_end` | YYYY-MM-DD | No | The date you will close your call for proposals. Can be a blank value. | 2016-01-05 |
55+
| `cfp_date_end` | YYYY-MM-DD | No | The date you will close your call for proposals. Can be a blank value. If you set the full datetime string with correct TZ, CFP will display as open until local close time. | 2016-01-05T23:59:00-06:00 |
5656
| `cfp_date_announce` | YYYY-MM-DD | No | The date you will inform proposers of status. Can be a blank value. | 2016-01-05 |
5757
| `cfp_open` | String | No | Either "true" or "false". Can be blank. This controls whether or not the "propose" button shows on your event page. *Deprecated field; if you have set `cfp_date_start` and `cfp_date_end` they will serve the same purpose.* | "true" |
5858
| `cfp_link` | String | No | If you have a custom link for submitting proposals, add it here. This will control the Propose menu item as well as the "Propose" button. | "https://myurlhere" |

exampleSite/data/events/2018-singapore.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ enddate: 2018-10-12 # The end date of your event. Leave blank if you don't have
1111

1212
# Leave CFP dates blank if you don't know yet, or set all three at once.
1313
cfp_date_start: 2018-07-05 # start accepting talk proposals.
14-
cfp_date_end: 2018-08-31 # close your call for proposals.
14+
cfp_date_end: 2018-08-31T00:00:00+08:00 # close your call for proposals.
1515
cfp_date_announce: 2018-09-11 # inform proposers of status
1616

1717
cfp_open: "false"
@@ -277,4 +277,3 @@ program:
277277
date: 2018-10-12
278278
start_time: "16:45"
279279
end_time: "17:00"
280-

layouts/partials/events/cta.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<!-- propose button -->
5252
{{- if $e.startdate -}}
5353
{{- if $e.cfp_date_start -}}
54-
{{- if and (ge (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) (dateFormat "2006-01-02" $e.cfp_date_start)) (le (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) (dateFormat "2006-01-02" $e.cfp_date_end)) -}}
54+
{{- if and (ge now (time $e.cfp_date_start)) (le now (time $e.cfp_date_end)) -}}
5555
{{- if $e.cfp_link -}}
5656
{{- if eq $e.cfp_link "" -}}
5757
{{- $.Scratch.Set "cfp_link" ((printf "/events/%s/propose" $e.name) | absURL ) -}}

layouts/partials/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h2 class="footer-heading">{{ dateFormat "02 January, 2006" .Date }}</h2>
4747
<h3 class="footer-nav">CFP OPEN</h3>
4848
{{- range sort $.Site.Data.events "startdate" -}}
4949
{{- if .cfp_date_end -}}
50-
{{- if and (ge (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) (dateFormat "2006-01-02" .cfp_date_start)) (ge (dateFormat "2006-01-02" .cfp_date_end) (dateFormat "2006-01-02" (dateFormat "2006-01-02" now))) -}}
50+
{{- if and (ge now (time .cfp_date_start)) (ge (time .cfp_date_end) now) -}}
5151
<a href = "{{ (printf "events/%s" .name) | absURL }}" class = "footer-content">{{ .city }}</a><br />
5252
{{- end -}} {{/* end: date is now or afterwards */}}
5353
{{- end -}} {{/* end: if .cfp_date_end */}}

layouts/partials/speaking.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{{- $.Scratch.Add "events" "<table class = 'table sortable table-condensed'><thead><tr><th>City</th><th>&nbsp;&nbsp;CFP Closes</th><th>&nbsp;&nbsp;&nbsp;&nbsp;Event Starts</th></tr></thead><tbody>" -}}
22
{{- range sort $.Site.Data.events "startdate" -}}
33
{{- if .cfp_date_end -}}
4-
{{- if and (ge (dateFormat "2006-01-02" (dateFormat "2006-01-02" now)) (dateFormat "2006-01-02" .cfp_date_start)) (ge (dateFormat "2006-01-02" .cfp_date_end) (dateFormat "2006-01-02" (dateFormat "2006-01-02" now))) -}}
4+
{{- if and (ge now (time .cfp_date_start)) (ge (time .cfp_date_end) now) -}}
55
{{- $.Scratch.Add "events" "<tr><td><a href = '/events/" -}}
66
{{- $.Scratch.Add "events" .name -}}
77
{{- $.Scratch.Add "events" "/' class = 'speaking'>" -}}
88
{{- $.Scratch.Add "events" .city -}}
99
{{- $.Scratch.Add "events" "</a></td><td data-dateformat='YYYY-MM-DD'>&nbsp;&nbsp;" -}}
10-
{{- $.Scratch.Add "events" .cfp_date_end -}}
10+
{{- $.Scratch.Add "events" (dateFormat "2006-01-02" .cfp_date_end) -}}
1111
{{- $.Scratch.Add "events" "</td><td data-dateformat='YYYY-MM-DD'>&nbsp;&nbsp;&nbsp;&nbsp;" -}}
12-
{{- $.Scratch.Add "events" .startdate -}}
12+
{{- $.Scratch.Add "events" (dateFormat "2006-01-02" .startdate) -}}
1313
{{- $.Scratch.Add "events" "</td></tr>" -}}
1414
{{- end }} {{/* end: date is now or afterwards */}}
1515
{{- end }} {{/* end: if .cfp_date_end */}}

0 commit comments

Comments
 (0)