andrewbrereton / obsidian-to-ical-plugin

This is a plugin for Obsidian that searches your vault for tasks that contain dates, and generates a calendar in iCal format that can be imported into your preferred calendar application.
MIT License
56 stars 10 forks source link

(FR) Make the date adjust after completion #67

Open bepolymathe opened 6 months ago

bepolymathe commented 6 months ago

Hi @andrewbrereton

Unless I'm mistaken, when a task is completed, it's simply marked with an icon ✅. This is very practical, but it would be even more so if the date were changed to match the completion date. Very useful when you visualize everything in a calendar.

For example. An event planned for tomorrow but finally carried out today could appear as ✅ today. For this to happen, the scheduled date would have to be adjusted. Without affecting the due date.

Eventually, "Initial planning: 2024-02-20" could appear in the description for those who need to keep track.

Your opinion about this ?

andrewbrereton commented 6 months ago

Hi @bepolymathe

Yes, a completed task gets the ✅ emoji. The rules are for task status:

You'll notice in the above examples that the date is just a bare date. i.e.: It is not using Tasks format.

In the example you provided, there is one status (Incomplete, in process, cancelled, done) derived from the [ ], and one date which is extracted from the line. I don't have a way to determine any more information than that, so that is all you will see in your calendar.

However, if you use the Tasks plugin format, you can configure the "how to process multiple dates" setting to choose how you want your calendar events to be created.

I'll explain them here:

If you choose "prefer start date"

  1. If task has a start date, then set event start date to that date,
  2. Otherwise if task has a due date, then set event start date to that date,
  3. Otherwise, find any date in the task and use that.

If you choose "create multiple events"

  1. If task has a start date, then set event start date to that date,
  2. And, if task has a scheduled date, then create another event with the scheduled date,
  3. And, if task has a due date, then create another event with the due date,
  4. And, if task has another date, then create another event with that date.

If you choose "prefer due date"

  1. If task has a start date, then set event start date to that date,
  2. Otherwise, if task has a due date, then set event start date to due date,
  3. Otherwise, find any date in the task and use that.

Hopefully the above is clear. I'm wondering if "create multiple events" suits your use case here.

bepolymathe commented 6 months ago

Hi @andrewbrereton

Thank you for these details. It’s clear. I'm just wondering if changing the status to "done" might be accompanied by an adjustment of the DTSTART: in the .ics file to match the completion date. But perhaps it's a need not shared by other users. I just find it very handy to see when I've completed a task in the calendar. But it's true that this implies an implementation based on the Tasks format, which isn't in the current spirit of the plugin.

I use the "create multiple events" option and I'm very happy with it (thank you very much for implementing it 👍🏼).