Skip to content
This repository was archived by the owner on Jul 7, 2026. It is now read-only.

feat: grouped export and import#211

Open
stefanbildl wants to merge 1 commit into
caarlos0:mainfrom
stefanbildl:56-feature-resume-timer-on-existing-task
Open

feat: grouped export and import#211
stefanbildl wants to merge 1 commit into
caarlos0:mainfrom
stefanbildl:56-feature-resume-timer-on-existing-task

Conversation

@stefanbildl

Copy link
Copy Markdown
Contributor

Export or import tasks grouped by desc

I found the grouped task issue #56 interesting and wanted to give it a try.

First of all, I preserved the standard json output format. So everything is backwards compatible.

I added a new flag -g (--grouped) to the to-json command that exports the tasks grouped by title.
If you restart a task with r in the UI or reuse an existing name, the grouped json output collects the ones with the same name.

The from-json import command works with both formats. It automatically detects which one was used.

❯ tt to-json -p example -g
{
  "task 1": [
    {
      "start": "2026-04-23T17:39:10+02:00",
      "end": "2026-04-23T17:39:22+02:00"
    },
    {
      "start": "2026-04-23T17:39:01+02:00",
      "end": "2026-04-23T17:39:08+02:00"
    }
  ],
  "task 2": [
    {
      "start": "2026-04-23T17:39:08+02:00",
      "end": "2026-04-23T17:39:10+02:00"
    }
  ],
  "task 3": [
    {
      "start": "2026-04-23T17:39:34+02:00",
      "end": "2026-04-23T17:39:39+02:00"
    },
    {
      "start": "2026-04-23T17:39:27+02:00",
      "end": "2026-04-23T17:39:33+02:00"
    },
    {
      "start": "2026-04-23T17:39:22+02:00",
      "end": "2026-04-23T17:39:24+02:00"
    }
  ]
}`

I preferred this format because the solution proposed by #56 (comment) was a bit too complex for my taste.

I hope you like it :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant