diff --git a/Gemfile.lock b/Gemfile.lock index 212e3aee..2ec536cd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - jekyll-theme-conference (3.1.5) + jekyll-theme-conference (3.2.0) jekyll (~> 4.0) GEM diff --git a/README.md b/README.md index 95532df5..cdc69fff 100644 --- a/README.md +++ b/README.md @@ -514,7 +514,7 @@ The order of the rooms in the list defines the order of the rooms as shown in th Each talk consists of - a `name` (must correspond to one of the talk identifier), -- a starting time `time_start` given as `H:M` ([`strftime`](http://www.strfti.me) formated), and +- a starting time `time_start` given as `H:M` ([`strftime`](http://www.strfti.me) formated) or `H:M +∆` whereby ∆ is the day offset in relation to the date given for the given day, and - an end time `time_end`. The list of talks should (manually) be ordered by time, i.e. the first occurring talk should be listed first. diff --git a/_includes/partials/get_day_time.html b/_includes/partials/get_day_time.html index 542cb8ad..1663ccfe 100644 --- a/_includes/partials/get_day_time.html +++ b/_includes/partials/get_day_time.html @@ -2,8 +2,9 @@ {%- assign t = r.talks | first -%} {%- include partials/get_talk_time.html -%} - {%- if forloop.index == 1 or talk_start_hour < day_start_hour or talk_start_hour == day_start_hour and talk_start_min < day_start_min-%} + {%- if forloop.index == 1 or talk_start_day < day_start_day or talk_start_day == day_start_day and talk_start_hour < day_start_hour or talk_start_hour == day_start_hour and talk_start_min < day_start_min-%} {%- assign day_start_talk = t -%} + {%- assign day_start_day = talk_start_day -%} {%- assign day_start_hour = talk_start_hour -%} {%- assign day_start_min = talk_start_min -%} {%- endif -%} @@ -11,8 +12,9 @@ {%- assign t = r.talks | last -%} {%- include partials/get_talk_time.html -%} - {%- if forloop.index == 1 or talk_end_hour > day_end_hour or talk_end_hour == day_end_hour and talk_end_min > day_end_min-%} + {%- if forloop.index == 1 or talk_end_day > day_end_day or talk_end_day == day_end_day and talk_end_hour > day_end_hour or talk_end_hour == day_end_hour and talk_end_min > day_end_min-%} {%- assign day_end_talk = t -%} + {%- assign day_end_day = talk_end_day -%} {%- assign day_end_hour = talk_end_hour -%} {%- assign day_end_min = talk_end_min -%} {%- endif -%} diff --git a/_includes/partials/get_talk_time.html b/_includes/partials/get_talk_time.html index 483e99ed..9c58c349 100644 --- a/_includes/partials/get_talk_time.html +++ b/_includes/partials/get_talk_time.html @@ -1,9 +1,24 @@ {%- assign talk_start = t.time_start -%} {%- assign talk_end = t.time_end -%} -{%- assign talk_start_hour = talk_start | split: ':' | first -%} +{%- if talk_start contains ' +' -%} + {%- assign talk_start_day = talk_start | split: ' +' | last | plus: 0 -%} + {%- assign talk_start = talk_start | split: ' +' | first -%} +{%- else -%} + {%- assign talk_start_day = 0 -%} +{%- endif -%} +{%- if talk_end contains ' +' -%} + {%- assign talk_end_day = talk_end | split: ' +' | last | plus: 0 -%} + {%- assign talk_end = talk_end | split: ' +' | first -%} +{%- else -%} + {%- assign talk_end_day = 0 -%} +{%- endif -%} + +{%- assign talk_start_hour = talk_start | split: ':' | first | plus: 0 -%} {%- assign talk_start_min = talk_start | split: ':' | last | divided_by: site.conference.program.time_steps | floor | times: site.conference.program.time_steps -%} -{%- assign talk_end_hour = talk_end | split: ':' | first -%} +{%- assign talk_end_hour = talk_end | split: ':' | first | plus: 0 -%} {%- assign talk_end_min = talk_end | split: ':' | last | divided_by: site.conference.program.time_steps | ceil | times: site.conference.program.time_steps -%} -{%- assign talk_duration_min = talk_end_hour | minus: talk_start_hour | times: 60 | minus: talk_start_min | plus: talk_end_min -%} +{%- assign talk_start_hour_24h = talk_start_day | times: 24 | plus: talk_start_hour -%} +{%- assign talk_end_hour_24h = talk_end_day | times: 24 | plus: talk_end_hour -%} +{%- assign talk_duration_min = talk_end_hour_24h | minus: talk_start_hour_24h | times: 60 | minus: talk_start_min | plus: talk_end_min -%} diff --git a/_includes/partials/get_talk_timestamp.html b/_includes/partials/get_talk_timestamp.html index 10aad891..894ef9f3 100644 --- a/_includes/partials/get_talk_timestamp.html +++ b/_includes/partials/get_talk_timestamp.html @@ -1,4 +1,9 @@ -{%- assign datetime_start = d.date | append: " " | append: t.time_start -%} -{%- assign timestamp_start = datetime_start | date: "%s" -%} -{%- assign datetime_end = d.date | append: " " | append: t.time_end -%} -{%- assign timestamp_end = datetime_end | date: "%s" -%} +{%- include partials/get_talk_time.html -%} + +{%- assign datetime_start = d.date | append: " " | append: time_start -%} +{%- assign add_days_start = talk_start_day | times: 24 | times: 60 | times: 60 -%} +{%- assign timestamp_start = datetime_start | date: "%s" | plus: add_days_start | date: "%s" -%} + +{%- assign datetime_end = d.date | append: " " | append: time_end -%} +{%- assign add_days_end = talk_end_day | times: 24 | times: 60 | times: 60 -%} +{%- assign timestamp_end = datetime_end | date: "%s" | plus: add_days_end | date: "%s" -%} diff --git a/_layouts/program.html b/_layouts/program.html index 2bbacd82..975f24d0 100644 --- a/_layouts/program.html +++ b/_layouts/program.html @@ -61,6 +61,10 @@

{%- include partials/get_day_time.html -%} + {%- if day_end_day > day_start_day -%} + {%- assign day_end_hour = day_end_day | minus: day_start_day | times: 24 | plus: day_end_hour -%} + {%- endif -%} + {%- assign day_duration_min = day_end_hour | minus: day_start_hour | times: 60 | minus: day_start_min | plus: day_end_min -%} {%- assign nbr_steps = day_duration_min | divided_by: site.conference.program.time_steps -%} @@ -74,7 +78,12 @@

= 24 -%} + {%- assign current_day = current_hour | divided_by: 24 | floor -%} + {%- assign current_hour = current_hour | modulo: 24 -%} + {%- endif -%} {%- assign current_min = i | minus: 1 | times: site.conference.program.time_steps | plus: day_start_min | modulo: 60 -%} {%- if current_min < 10 -%} {%- assign current_time = current_hour | append: ':0' | append: current_min -%} @@ -106,9 +115,9 @@

{%- endunless -%} diff --git a/_tools/create_entries.py b/_tools/create_entries.py index 7398c390..ad2bebfd 100644 --- a/_tools/create_entries.py +++ b/_tools/create_entries.py @@ -106,7 +106,6 @@ def parse_frab(file_path): content['speakers'][-1]['last_name'] = \ speaker_names[0] - abstract = talk['abstract'] description = talk['description'] @@ -133,11 +132,19 @@ def parse_frab(file_path): # Calculate talk end time talk_start = (talk['start']).split(':') talk_duration = (talk['duration']).split(':') - talk_end = [int(talk_start[0]) + int(talk_duration[0]), + + talk_end = [0, + int(talk_start[0]) + int(talk_duration[0]), int(talk_start[1]) + int(talk_duration[1])] - talk_end[0] = (talk_end[0] + talk_end[1] // 60) % 24 - talk_end[1] = talk_end[1] % 60 - talk_end = "{}:{:02d}".format(talk_end[0], talk_end[1]) + talk_end[1] = (talk_end[1] + talk_end[2] // 60) + talk_end[2] %= 60 + talk_end[0] = (talk_end[0] + talk_end[1] // 24) + talk_end[1] %= 24 + + # Indicate if talk is overlapping into next day + talk_end = '{:02d}:{:02d}{}'.format( + talk_end[1], talk_end[2], + ' +{}'.format(talk_end[0]) if talk_end[0] > 0 else '') content['program'].append({ 'name': talk['title'], diff --git a/jekyll-theme-conference.gemspec b/jekyll-theme-conference.gemspec index db72c746..f768fc72 100644 --- a/jekyll-theme-conference.gemspec +++ b/jekyll-theme-conference.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "jekyll-theme-conference" - spec.version = "3.1.5" + spec.version = "3.2.0" spec.authors = ["Lorenz Schmid"] spec.email = ["lorenzschmid@users.noreply.github.com"]