Skip to content

Commit

Permalink
Add extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
JesperDramsch committed Jan 7, 2024
1 parent 96955e6 commit 9dfb7c0
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 19 deletions.
1 change: 1 addition & 0 deletions _data/conferences.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
link: https://pycon.de/
cfp_link: https://pretalx.com/pyconde-pydata-2024/cfp
cfp: '2023-12-22 23:59:59'
cfp_extensions: '2024-01-07 23:59:59'
timezone: Europe/Berlin
place: Berlin, Germany
date: April 22 - 24, 2024
Expand Down
13 changes: 9 additions & 4 deletions _includes/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ function load_conference_list() {
// Gather data
var conf_list_all = [];
{% for conf in site.data.conferences + site.data.archive %}
{% if conf.cfp_extension %}
var cfp_string = "{{conf.cfp_extension}}";
{% else %}
var cfp_string = "{{conf.cfp}}";
{% endif %}
// add deadlines in red
conf_list_all.push({
id: "{{conf.title | slugify}}-{{conf.year}}-deadline",
Expand All @@ -91,8 +96,8 @@ function load_conference_list() {
location: "{{conf.place}}",
date: "{{conf.date}}",
subject: "{{conf.sub}}",
startDate: Date.parse("{{conf.cfp}}"),
endDate: Date.parse("{{conf.cfp}}"),
startDate: Date.parse(cfp_string),
endDate: Date.parse(cfp_string),
});
{% if conf.workshop_deadline %}
conf_list_all.push({
Expand All @@ -116,8 +121,8 @@ function load_conference_list() {
location: "{{conf.place}}",
date: "{{conf.date}}",
subject: "{{conf.sub}}",
startDate: Date.parse("{{conf.cfp}}"),
endDate: Date.parse("{{conf.cfp}}"),
startDate: Date.parse(cfp_string),
endDate: Date.parse(cfp_string),
});
{% endif %}

Expand Down
6 changes: 3 additions & 3 deletions _layouts/calendar.ics
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ DTSTAMP:{{ site.time | date: "%Y%m%dT%H%M%SZ" }}
DTSTART;TZID={{ conf.timezone }}:{{ conf.tutorial_deadline | date: "%Y%m%dT%H%M%S" }}
{% endif %}END:VEVENT{% endif %}
{% if conf.cfp != "TBA" %}BEGIN:VEVENT
SUMMARY:{{ conf.title }} {{ conf.year }} Deadline
SUMMARY:{{ conf.title }} {{ conf.year }} Deadline{% if conf.cfp_extension %} (Extended){% endif %}
UID:{{ conf.id }} {% if conf.timezone contains "UTC" %} {% assign tz = conf.timezone | split: "UTC" %} {% if tz[1] contains "-" %} {% assign tz = tz[1] | replace: "-", "+" %} {% else if tz[1] contains "+" %} {% assign tz = tz[1] | replace: "+", "-" %} {% else assign tz = tz[1] %} {% endif %}
ORGANIZER:pythondeadlin.es
DTSTAMP:{{ site.time | date: "%Y%m%dT%H%M%SZ" }}
DTSTART;TZID=Etc/GMT{{ tz }}:{{ conf.cfp | date: "%Y%m%dT%H%M%S" }}
DTSTART;TZID=Etc/GMT{{ tz }}:{% if conf.cfp_extension %}{{ conf.cfp_extension | date: "%Y%m%dT%H%M%S" }}{% else %}{{ conf.cfp | date: "%Y%m%dT%H%M%S" }}{% endif %}
{% else %}
ORGANIZER:pythondeadlin.es
DTSTAMP:{{ site.time | date: "%Y%m%dT%H%M%SZ" }}
DTSTART;TZID={{ conf.timezone }}:{{ conf.cfp | date: "%Y%m%dT%H%M%S" }}
DTSTART;TZID={{ conf.timezone }}:{% if conf.cfp_extension %}{{ conf.cfp_extension | date: "%Y%m%dT%H%M%S" }}{% else %}{{ conf.cfp | date: "%Y%m%dT%H%M%S" }}{% endif %}
{% endif %}END:VEVENT
{% endif %}
{%- endfor -%}END:VCALENDAR
16 changes: 11 additions & 5 deletions _layouts/conference.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#twitter-widget {
width: 100%;
}

.twitter-timeline {
width: 100% !important;
}
Expand Down Expand Up @@ -203,20 +203,26 @@ <h1>
$('.deadline-local-time').html("TBA");
{% else %}

{% if page.cfp_extension %}
var cfp_string = "{{conf.cfp_extension}}";
{% else %}
var cfp_string = "{{conf.cfp}}";
{% endif %}

// Use specified timezone for deadlines if available else use AoE timezone
{% if page.timezone %}
var confDeadline = DateTime.fromSQL("{{page.cfp}}", { zone: "{{page.timezone}}" });
var confDeadline = DateTime.fromSQL(cfp_string, { zone: "{{page.timezone}}" });
{% else %}
var confDeadline = DateTime.fromSQL("{{page.cfp}}", { zone: "UTC-12" });
var confDeadline = DateTime.fromSQL(cfp_string, { zone: "UTC-12" });
{% endif %}

// check if timezone is valid otherwise replace by system timezone
if (confDeadline.invalid) {
var confDeadline = DateTime.fromSQL("{{page.cfp}}");
var confDeadline = DateTime.fromSQL(cfp_string);
console.log("Invalid timezone. Using system timezone instead.");
}

// add calendar
// add calendar
var conferenceDeadlineCalendar = createCalendarFromObject({
id: '{{conf.title | slugify}}-{{conf.year}}',
title: '{{page.title}} {{page.year}} deadline',
Expand Down
13 changes: 10 additions & 3 deletions _pages/archive.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,25 @@ <h1 id="past-events-title">Past Events</h1>
$('#{{conf.title | slugify}}-{{conf.year}}').attr("cfpDiff", Infinity);
{% else %}


{% if page.cfp_extension %}
var cfp_string = "{{conf.cfp_extension}}";
{% else %}
var cfp_string = "{{conf.cfp}}";
{% endif %}

// Use specified timezone for deadlines if available else use AoE timezone
{% if conf.timezone %}
var cfpDate = DateTime.fromSQL("{{conf.cfp}}", {zone: "{{conf.timezone}}"});
var cfpDate = DateTime.fromSQL(cfp_string, {zone: "{{conf.timezone}}"});
var confDate = DateTime.fromSQL("{{conf.start}}", {zone: "{{conf.timezone}}"});
{% else %}
var cfpDate = DateTime.fromSQL("{{conf.cfp}}", {zone: "UTC-12"});
var cfpDate = DateTime.fromSQL(cfp_string, {zone: "UTC-12"});
var confDate = DateTime.fromSQL("{{conf.start}}", {zone: "UTC-12"});
{% endif %}

// check if timezone is valid otherwise replace by system timezone
if (cfpDate.invalid || confDate.invalid) {
var cfpDate = DateTime.fromSQL("{{conf.cfp}}");
var cfpDate = DateTime.fromSQL(cfp_string);
var confDate = DateTime.fromSQL("{{conf.start}}");
console.log("Invalid timezone in {{conf.title | slugify}}-{{conf.year}}. Using system timezone instead.");
}
Expand Down
6 changes: 5 additions & 1 deletion feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@
<item>
<title>{{ conf.title | xml_escape }} {{ conf.year }} Conference Deadline</title>
<description>Conference in {{conf.place | xml_escape }} on {{conf.date | xml_escape }}. CfP: {{ conf.cfp | xml_escape }} {% if conf.zimezone %}{{ conf.timezone | xml_escape }}{% else%}AoE{% endif %}.{% if conf.twitter %}&lt;br /&gt;Find them here: @{{ conf.twitter}}{% endif %} </description>
{% if conf.cfp_extension %}
<pubDate>{{ conf.cfp_extension | date: "%Y-%m-%d %H:%M:%S" | date_to_rfc822 }}</pubDate>
{% else %}
<pubDate>{{ conf.cfp | date: "%Y-%m-%d %H:%M:%S" | date_to_rfc822 }}</pubDate>
{% endif %}
<link>https://{{ site.domain }}/conference/{{conf.title | slugify}}-{{conf.year}}/</link>
<guid isPermaLink="false">{{ conf.id }}</guid>
<category>{{ conf.sub }}</category>
</item>
{% endif %}
{% endfor %}
</channel>
</rss>
</rss>
11 changes: 8 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,22 @@ <h1 id="archive-link">Visit the <a href="/archive/">Archive</a></h1>
{% else %}

// Use specified timezone for deadlines if available else use AoE timezone
{% if conf.cfp_extension %}
var cfp_string = "{{conf.cfp_extension}}";
{% else %}
var cfp_string = "{{conf.cfp}}";
{% endif %}
{% if conf.timezone %}
var cfpDate = DateTime.fromSQL("{{conf.cfp}}", {zone: "{{conf.timezone}}"});
var cfpDate = DateTime.fromSQL(cfp_string, {zone: "{{conf.timezone}}"});
var confDate = DateTime.fromSQL("{{conf.start}}", {zone: "{{conf.timezone}}"});
{% else %}
var cfpDate = DateTime.fromSQL("{{conf.cfp}}", {zone: "UTC-12"});
var cfpDate = DateTime.fromSQL(cfp_string, {zone: "UTC-12"});
var confDate = DateTime.fromSQL("{{conf.start}}", {zone: "UTC-12"});
{% endif %}

// check if timezone is valid otherwise replace by system timezone
if (cfpDate.invalid || confDate.invalid) {
var cfpDate = DateTime.fromSQL("{{conf.cfp}}");
var cfpDate = DateTime.fromSQL(cfp_string);
var confDate = DateTime.fromSQL("{{conf.start}}");
console.log("Invalid timezone in {{conf.title | slugify}}-{{conf.year}}. Using system timezone instead.");
}
Expand Down

0 comments on commit 9dfb7c0

Please sign in to comment.