Calendar and tasks for daily notes

Did you get it to work?

Might interest you too: I wrote some Python that generates a note for each week with the daily notes of that week already transcluded.

Want to use that for my weekly review and have them directly linked in my calendar note

def getDatesfromWeek(year,week): # create list of isoformat dates for a given year & week 
    firstdayofweek = datetime.datetime.strptime(f'{year}-W{week - 1}-1', "%Y-W%W-%w").date()
    dates = []
    for i in range(7):
        date = firstdayofweek + datetime.timedelta(days=i)
        dates.append(date.isoformat())
    return dates

days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]

path_folder="C:\\Users\{Username}\{Folder}" 

for i in range(53):
    dates = getDatesfromWeek('2020',i+1) # get list of dates for the week
    
    m = "" # create empty string
    for j in range(len(days)): # go through number of days in each week
        n = "## " + days[j] + ", " + dates[j] + "\n\n" + "![[" + dates[j] + "]]" + "\n\n" # create heading and transcluded daily note
        m += n # add to note for the week
        
    filename = "{}\\2020-W{}.md".format(path_folder, i+1) # create filename based on week
    with open(filename, 'w') as f: 
        f.write(m) # write text to file 
6 Likes