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
61 stars 15 forks source link

Enhancement & fix: Add dayplanner format support without time heading ; fix time format error in `DTSTART` and `DTEND` #92

Open JeffeyChou opened 3 months ago

JeffeyChou commented 3 months ago

I cancel my previous pull request due to some incompleted code. Now I make a new pull request.

Dear andrewbrereton:

I make some enhancement and bug fix in my code. Such modification is relate to issue #89

The problem in this issue lies in that a time heading is needed by default in your current code, while some of us don't use time as heading, so it can not recognize the correct time.

I add a function to recognize task+day planner format: - [ ] 08:00 - 10:00 This is a test ⏳ 2024-07-23


The other thing I done is that I noticed that your test .ics file has some incorrect time format in DTSTART : incorrect time format

They also miss the DTEND field.

Another problem is that sometimes the time is recognized incorrectly. incorrect time

So I fix this, and add DTEND field by default with time 30 mins after start time. :) Correct time

So I made this pull request :P


limition

when task+day planner format is attached after a time heading, it will use the time in the heading instead of the time in task.

e.g.

### 2024-01-01
17:01 id=160, start time only, (hour)(:)(minute) format 📅 2024-08-03 

It will generate

DTSTART:20240101T170100
DTEND:20240101T173100
SUMMARY:🔲 17:01 id=129\, start time only\, (hour)(:)(minute) format

which is expected to be :

DTSTART:20240803T170100
DTEND:20240803T173100
SUMMARY:🔲 17:01 id=160\, start time only\, (hour)(:)(minute) format
daniilium commented 2 months ago

Great work! Please create a release in your branch. I want to test this version using BRAT: https://github.com/TfTHacker/obsidian42-brat