Skip to content

Commit

Permalink
make events with no time all day long
Browse files Browse the repository at this point in the history
  • Loading branch information
hjonin committed Sep 5, 2023
1 parent 4ee84d5 commit a14c139
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions content/calendar/calendar.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ permalink: /calendar.ics
{% set hour = event.data.date | getHour %}
{% set minute = event.data.date | getMinute %}
{
"start": [
{{ year }}, {{ month }}, {{ day }}, {{ hour }}, {{ minute }}
],
"duration": { "minutes": {{ event.data.duration or 0 }} },
{% if hour == 0 and minute == 0 %}
"start": [ {{ year }}, {{ month }}, {{ day }} ],
"end": [ {{ year }}, {{ month }}, {{ day + 1 }} ],
{% else %}
"start": [ {{ year }}, {{ month }}, {{ day }}, {{ hour }}, {{ minute }} ],
"duration": { "minutes": {{ event.data.duration or 60 }} },
{% endif %}
"title": "{{ event.data.title }}",
"description": "{{ event.data.description }}",
"location": "{{ event.data.location }}",
Expand Down

0 comments on commit a14c139

Please sign in to comment.