Skip to content

Commit

Permalink
Merge branch 'main' into wd-jupyter-proj
Browse files Browse the repository at this point in the history
  • Loading branch information
eirinikos authored Sep 20, 2024
2 parents bf402e9 + c037f99 commit 63025db
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
28 changes: 14 additions & 14 deletions docs/_data/atlantic-2024-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ buttons:
# link: /welcome-wagon
#- text: See the Schedule!
# link: /schedule
- text: Tickets
link: /tickets
# - text: Ticket
# link: /tickets
#- text: Sponsor us
# link: /sponsors/prospectus
#- text: Submit a Talk
# link: /cfp
#- text: See the talks!
# link: /speakers
- text: See the talks!
link: /speakers
- text: See the Schedule!
link: /schedule
# - text: Watch the Live Stream
Expand All @@ -46,14 +46,14 @@ buttons:
bottom:
# - text: Welcome to our conference
# link: /news/welcome
#- text: See the Schedule!
# link: /schedule
- text: Sponsor the conference
link: /sponsors/prospectus
# - text: See the talks!
# link: /speakers
- text: Buy a Ticket!
link: /tickets
- text: See the Schedule!
link: /schedule
# - text: Sponsor the conference
# link: /sponsors/prospectus
- text: See the talks!
link: /speakers
# - text: Buy a Ticket!
# link: /tickets
# - text: Prepare with the Welcome Wagon
# link: /welcome-wagon
# - text: See the schedule!
Expand Down Expand Up @@ -187,8 +187,8 @@ sponsors:
flagcfp: False
flaglanding: False
flaghassponsors: True
flagticketsonsale: True
flagsoldout: False
flagticketsonsale: False
flagsoldout: True
flagspeakersannounced: True
flagrunofshow: False
flaghasschedule: True
Expand Down
21 changes: 17 additions & 4 deletions docs/_ext/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .utils import load_yaml

import logging
import sys
from datetime import datetime, time, timedelta

try:
Expand All @@ -17,11 +18,23 @@

log = logging.getLogger(__name__)


def get_24hour_time(dt):
return dt.strftime('%H:%M')


def get_12hour_time(dt):
hour = dt.strftime('%I')
hour = hour.lstrip('0')
return f'{hour}:{dt.strftime("%M %p")}'


TIME_FORMATS = {
'24h': '%H:%M',
'12h': '%-I:%M %p',
'24h': get_24hour_time,
'12h': get_12hour_time,
}


# Some DST timezones aren't "real" timezones.
TIMEZONE_TRANSLATION_PYTZ = {
'CEST': 'CET',
Expand Down Expand Up @@ -134,15 +147,15 @@ def load_conference_context_from_yaml(shortcode, year, year_str, page):
)
if not display_timezones:
# In a single-tz schedule, render just naive time, first schedule item with TZ
schedule_item['time'] = naive_item_start.strftime(TIME_FORMATS[data['time_format']])
schedule_item['time'] = TIME_FORMATS[data['time_format']](naive_item_start)
if not naive_next_item_default_start and not data.get('flaghasfood'):
schedule_item['time'] += ' ' + data['tz']
if display_timezones:
# In multi-timezone, first convert to aware, then format for each timezone.
# Note that we need to combine with conf date to know whether there is DST.
aware_item_start = datetime.combine(conf_date, naive_item_start.time()).replace(tzinfo=conf_timezone)
schedule_item['time'] = '<br>'.join([
aware_item_start.astimezone(tz).strftime(TIME_FORMATS[data['time_format']]) + ' ' + tz_name
TIME_FORMATS[data['time_format']](aware_item_start.astimezone(tz)) + ' ' + tz_name
for tz_name, tz in display_timezones
])
naive_next_item_default_start = naive_item_start + duration
Expand Down

0 comments on commit 63025db

Please sign in to comment.