khal icon indicating copy to clipboard operation
khal copied to clipboard

JSON output has no indication of the current-moving date

Open mirabilos opened this issue 4 months ago • 3 comments

It would be helpful if the JSON output contained the date it was emitted for.

With the current format, the only option is to include that with every event.

Otherwise, instead of emitting multiple JSONArray of event-JSONObject documents, emit a single JSONArray of JSONObject(date: JSONArray of event-JSONObject), that’s even easier to parse (multi-document support exists in few JSON parsers).

mirabilos avatar Aug 12 '25 16:08 mirabilos

It would be helpful if the JSON output contained the date it was emitted for.

The date for each event is included with:

khal list --json=title --json start-date

instead of emitting multiple JSONArray of event-JSONObject documents, emit a single JSONArray

I think that would have been preferible. What we're currently emitting is technically JSONL.

WhyNotHugo avatar Aug 13 '25 14:08 WhyNotHugo

Hugo dixit:

The date for each event is included with:

khal list --json=title --json start-date

Is that not included in --json all?

The start date is NOT necessarily the date the line was emitted for (think multi-day all-day events like a vacation planner).

mirabilos avatar Aug 14 '25 01:08 mirabilos

I see what you mean. If you print all events for this week, a week-long event is printed five times. You want to understand to which day each one corresponds.

WhyNotHugo avatar Aug 14 '25 10:08 WhyNotHugo