From a14c13956e992674ae80150c0c2a1799cbb2de49 Mon Sep 17 00:00:00 2001 From: hjonin Date: Tue, 5 Sep 2023 15:15:13 +0200 Subject: [PATCH] make events with no time all day long --- content/calendar/calendar.njk | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/content/calendar/calendar.njk b/content/calendar/calendar.njk index 98f58fa2..2b853ff5 100644 --- a/content/calendar/calendar.njk +++ b/content/calendar/calendar.njk @@ -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 }}",