Obsidian-Tasks-Timeline icon indicating copy to clipboard operation
Obsidian-Tasks-Timeline copied to clipboard

Dynamic taskFolder/dateFormat

Open uzza1hossain opened this issue 1 year ago • 7 comments

In the Daily notes core plugin, I set up the Date format as YYYY/MM-MMMM/YYYY-MM-DD and the New file location as timestamps.

So it creates a hierarchy, as below

timestamps/
└── 2023
    └── 08-August
        ├── 2023-08-07.md
        ├── 2023-08-09.md
        └── 2023-08-10.md

So when I add tasks from the daily notes (that's where I put the tasks timeline) it should add tasks on the same file or follow the hierarchy. I tried to set up dailyNoteFolder, dailyNoteFormat , and dateFormat but I couldn't achieve the expected outcome. Is there anything I am doing wrong, or it's not possible to put the task on the same file or follow the hierarchy same as Daily notes?

uzza1hossain avatar Aug 09 '23 14:08 uzza1hossain

I have my dailynotes set up in a similar fashion. You shouldn't have to specify the date format the same that you set for Daily Tasks, just leave it as the default YYYY-MM-DD as that is the format for the file itself. The way you have it set currently is just to trick Obsidian into creating the new folders.

ablizno avatar Aug 09 '23 15:08 ablizno

Yes, I want obsidian to create the folder and I like the tasks-timeline to add tasks on the same file when I add tasks from the quick input box. But it can't find the actual file. It creates a new file to add tasks. @ablizno

uzza1hossain avatar Aug 09 '23 17:08 uzza1hossain

Ah I misunderstood. I thought you were saying they weren't showing up on the timeline. You want the quick entry box to add tasks to your daily note?

ablizno avatar Aug 09 '23 22:08 ablizno

Yes @ablizno

uzza1hossain avatar Aug 10 '23 02:08 uzza1hossain

I’ll see what I can do.

ablizno avatar Aug 11 '23 21:08 ablizno

Kinda hacky, but I was able to come up with a work around.

For your usecase, set your dailyNoteFolder like this:

dailyNoteFolder: "timestamps/" + moment().format("YYYY/MM-MMMM")

ablizno avatar Aug 12 '23 18:08 ablizno

I made a change in the code that works for my usecase, I'm not making a PR since this will be a breaking change.

Basically I changed: const currentDailyNote = dailyNoteRootFolder + moment().format(dailyNoteFolder) + moment().format(dailyNoteFormat) + ".md";

image

NiviJah avatar Sep 19 '23 13:09 NiviJah