This commit is contained in:
Ludwig Behm 2023-10-18 13:11:53 +02:00
commit f1a7e0dd42
Signed by: l.behm
GPG key ID: D344835D63B89384
3 changed files with 25 additions and 0 deletions

10
jcal-unfuck.jq Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/jq -rfc
[
(
.[2][] # skipping calender header and accessing events
| [["_type", {}, "text", .[0]], .[1][]] # adding ical type like 'vevent' as ._type property
| [.[] | {"key": .[0], "value": .[3]}] | from_entries # transforming event array structure into object structure
| pick(._type, .dtstart, .dtend, .summary, .location, .description, .sequence, .["related-to"]) # allow list of properties
)
]
| sort_by(.dtstart|fromdate) # sorting by event start time