-
Notifications
You must be signed in to change notification settings - Fork 7
startDate output format doesn't match date input format. #3
Description
I would like to have a command that will give me a list of my next few events with the (12H) time they start. So, I started with the example for a daily events, and I run this to get a json list of events for the day:
ekctl list events --calendar work --from "$NOWISH" --to "$TOMORROW" |
And then I expect to be able to pipe that through jq like this:
jq '.events.[] | {title,startDate:.startDate | strptime("%Y-%m-%dT%H:%M:%S%:z")|mktime|strftime("%I:%M%p") } | "(.startDate) (.title)"'
But I get an error jq: error (at <stdin>:36): date "2026-03-09T16:00:00-04:00" does not match format "%Y-%m-%dT%H:%M:%S%:z"
JQ doesn't do a great job handling timezone/locale, so its not too surprising to get an error parsing (because the TZ has the colon in it). However, I was surprised that the format of the startDate in the output didn't match the format expected for input to --from and --to.
I will submit a PR. It looks like the issue is documented behavior due to differences between acceptable ISO 8601 dates and RFC 3339-specific dates.