Skip to content

Cannot create multi-day all-day events #108

@glynternet

Description

@glynternet

It would be great to be able to create multi-day all-day events; let me know if I'm mistaken and there is already a way to do this.

The following yaml

events:
  - summary: Single-day all-day event
    begin: 2025-01-01
  - summary: Multi-day all-day event (Jan 1st and 2nd)
    begin: 2025-01-01
    end: 2025-01-03

creates

BEGIN:VCALENDAR
VERSION:2.0
PRODID:ics.py 0.8.0-dev0 - http://git.io/lLljaA
BEGIN:VEVENT
DTSTART;VALUE=DATE:20250101
DTEND;VALUE=DATE:20250102
SUMMARY:Single-day all-day event
UID:[email protected]
DTSTAMP:20250106T012847Z
END:VEVENT
BEGIN:VEVENT
DTSTART:20250101T000000
DTEND:20250103T000000
SUMMARY:Multi-day all-day event (Jan 1st and 2nd)
UID:[email protected]
DTSTAMP:20250106T012847Z
END:VEVENT
END:VCALENDAR

When I created a multi-day all-day event in google calendar and exported it, the fields were

DTSTART;VALUE=DATE:20250101
DTEND;VALUE=DATE:20250103

It looks like we'd need a change to the code around here to hand when both begin and end are both dates rather than timestamps, or something like that?

yaml2ics/yaml2ics.py

Lines 79 to 81 in 1da44eb

# Handle all-day events
if not ("duration" in d or "end" in d):
event.make_all_day()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions