11 lines
479 B
Text
11 lines
479 B
Text
|
#!/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
|