Calendar and tasks for daily notes

Any way how to make it not depended on fixed naming convention?
I just edit script and add my ISO date formating and script should extract all the parts like: date, month day, a rebuild the note name when creating calendar.

I tried to edit current script with my ISO formatting:

linkformat="%ww' %DD-%MMM (%ddd) %Y"

But it create empty calendar.

how can I run it in Windows? :flushed:

1 Like

@jcperezh Because it uses date or gdate it will not run on windows natively. That are utilities only available on linux (or OSX)

You could try to install the Ubuntu (command line) from the windows store and run it from there.

Yes…that is what I did.

done! work great. im now trying to translate it to german (doesn’t work when the linux language is not English) this is my first attempt with .sh and i am trying to change the “Mon” and “Sun” with $hMon and $hSun so i can just translate the headers. not successful yet.

1 Like

@jcperezh That’s weird your approach should work. You have to change the other occurrences if “Mon” and “Sun” as well later in the code.

You are right, the language of the date command changes with the system language.
This can be prevented running the script a temporary environmental variable:

LANG=en_US ./

Note: Don’t for get to make the script executable first: chmod +x ./

done! i don’t know the syntax yet and didn’t use “$hSun”, just $hSun without the quotation marks :flushed: :roll_eyes:. it work perfect.

Edit: Now it is getting interesting, Week number in Europa and in USA are not the same…
Edit_2: %V instead of %W solved it (ISO Standard)

I created a link also to my Week-Note to the Week Number


Python script version (customizable) with KB script makro script!


I think it’s because the link is in a table. If you escape the pipe, it’s not gonna show: [[20200604\|4]] in preview mode.

Looks like a great change for the people in Europe :grinning:.
Would you mind sharing it?

Hi guys, I really want something like that. Sorry if the question is to stupid. I dont have any knolowge with this, but Im trying anyway to make this work here on Window. Can anyone help me?
I did these steps:

  • installed Ubuntu Command Line from windows store as suggested;
  • installed Windows Subsystem for Linux (WL2)
  • Set the startDate, endDate and dailyNotePath on script
  • Tried to execute and got this: 96: function: not found 1: gdate: not found 105: Bad substitution

Can someone point me to some direction to solve this?

on Linux u need to use “date” instead of gdate Screenshot_20200927-110219_File Manager +|690x140

1 Like

Thanks! My bad. I forgot that I was kind of using Linux on Windows

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)
    return dates

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


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 

Hi @juen!
Actually I haven’t been able to make it work yet. I realized that I know very little about the subject to know what I don’t know yet. hahaha
I solved only the error “gdate: not found”, but I didn’t have time to read the documentation more calmly and solve the other 2. So I decided to postpone the implementation of the calendar here.
As soon as I get some time to return to my calendar, I will test your code. Thank you very much for the suggestion! :slight_smile:

Actually, I got the shell script from @jcperezh and modified it to fit my daily note format (“daily notes/2020-10-07”). I generated the calendar file with all the right backlinks with it on Windows. If you want I’ll send you the modified script, you just need to enable Linux subsystem on Windows and install Ubuntu for Windows to run it (

@danbburg, perfect! Thanks for the script!

I’m using dates with spaces (e.g. linkFormat="%Y-%m-%d (%A)" -> 2020-10-19 (Monday)) so I had to change all instances of $date_cmd +$linkTemplate to have quotes: $date_cmd +"$linkTemplate", or else date thinks there’s more than one argument.

Also, I didn’t like the non-existing notes link to have a blue color (hard to distinguish, despite the existing ones being bold), so I cleared all highlights (hle, hlne, hlt), added a span with a class to both dates:

 if [ -e "$testFile" ]; then # Daily note file exists
        printf "| $hil$hle<span class=\"journal-calendar-date\">[[ %s \| %s ]]</span>$hle$hil " "`$date_cmd +"$linkTemplate" […]
    elif [ "$linkNonExisting" == true ]; then # Daily note file does not exists, but still make a link
        printf "| $hil$hlne<span class=\"journal-calendar-date\">[[ %s \| %s ]]</span>$hlne$hil " "`$date_cmd +"$linkTemplate" […]

and added it to obsidian.css:

.journal-calendar-date {
    color: white;

This way there’s no need to re-run the script to check for existing notes (just run it once per year!) and the style will change automatically.


Thanks again! :grinning:

4 Likes there is the original code. i just change it a little bit. (mostly for German translation and European ISO format)

I’m just wondering whether the idea of highlighting today’s date in the Calendar was ever developed further. I use the default Calendar that has today’s day in bold, but I would love a more conspicuous appearance like a fully highlighted square.

I have got inspired and created script in obsidian templater for automatic calendar creation in periodic notes.

1 Like