Calendar and tasks for daily notes

I used to work with Dynalist ( :heart:) a lot to log my work on a daily basis (meetings, ideas, readings, …) and I’ve structured it as a calendar log with folding weeks, months, years that helped me quickly “zoom in” a specific period of time and dive in by unfolding lists then zoom out by folding them again.

I also used it a lot to keep track of my tasks with a system of tags to match my own workflow.

I’ve started to use Obsidian a couple of weeks ago and it changed the way I organise my ideas. It really helps me to understand complex topics better by breaking them into atomic notes and connecting them.

So I’ve quickly decided to try to completely switch from dynalist to obsidian and try to extend its usage to a productivity tool.

The two things that I’ve struggled the most with were : an easy way to navigate in time and a way to manage tasks to accommodate with Obsidian current features.
After a couple of trials and fails I’ve achieve to find a way of working with Obsidian that suits my needs. I combine the daily note plugin, the zettelkasten note plugin and a Calendar note


The Daily note:

I use the daily note plugin with a date format like: YYYY MM DD, this way my daily notes are sorted by date in their folder. The template I use is still not perfect but it has on the top of it a link to the Calendar note that I’ll explain later, a Task section and a list section of 30 minute time blocks

let’s explain the sections from bottom to top

The 30 minute blocks “section”:

Here I keep track of meetings that don’t require a dedicated note (very simple idea).
If an idea becomes big enough I will eventually turn it into a dedicated note and put the backlink in the 30 minute block so that I keep track of “when” I’ve worked on that idea.

That’s how it looks like

The “task” section:

I use tags a lot. But due to way Obsidian works with files instead of blocks, when you click on a tag, the context of the tag in the search pane is too “heavy” for me because it takes a lot more than a single sentence: it takes all lines of text below it.

When I click on my #todo I just want to see the sentence that is after the tag to keep the search results as condensed as possible.

That’s where Zettelkasten notes come into play for me: I’ve turned on the Zettelkasten plugin and created a task folder to store them.

Whenever I have a task that I want to mark as “todo” I create a new Zettelkasten note, put a #todo tag at the beginning and briefly describe the task:

That’s what it looks like

image

I copy the title of this note and paste it where I want this task to appear: most of the time it’s in the “Task” section of my daily note.
When I hover the title of the zettelkasten note I can see the detail of the task

I would prefer to have a system that can embed this note directly but that okayish for the moment.

That’s 3 actions instead of just writing directly the “#todo do some stuff” in the task block but I’m okay with that for 3 reasons. First, I don’t record a lot of tasks todo (5 tops per day), so it’s no use to automate a lot. Second, when I work on a task, it often transforms into a more developed note (like meeting notes, ideas, links to other notes…), so with this system the “container” is ready “upfront” and I don’t have to decide whether I should create a dedicated note or not: it’s already done. Third and most important, when I click on the #todo in the tag pane, the search result just show me the tasks itself like this:

image

I find it much more readable than the todo tag showing up in the middle of a bunch of words if I would have put a #todo tag directly inside my daily note, leading to this kind of result which I find clumsy

Last the Calendar section:
it’s simply a link to the calendar note


The Calendar note

I’ve seen really cool posts explaining how to create breadcrumbs to navigate between dates. Here is how I manage date navigation in Obsidian: I’ve simply created a calendar note containing links to all past and future daily notes.

Here is the file if you’re interested in using it Calendar.md.zip (790 Bytes) .

You have to use the same date format YYYY MM DD as I do unless it won’t work. If you want to create your own it super easy with an excel formula because typing it in the Obsidian editor in markdown mode would be very hard.

I really think Obsidian team is doing a great work and that this product is brilliant. Congratulations to them.

45 Likes

My code is a little different. Hopefully, this will provide some additional ideas and inspiration.

I’m using backlinks instead of links. Depends if you want to see those connections in the Graph and Backlinks panels.

### June 2020
| SUN | MON | TUE | WED | THU | FRI | SAT |
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
| | 1 | 2 | 3 | [[20200604\|4]] | [[20200605\|5]] | [[20200606\|6]] |
| 7 | 8 | [[20200609\|9]] | [[20200610\|10]] | [[20200611\|11]] | [[20200612\|12]] | 13 |
| [[20200614\|14]] | [[20200615\|15]] | [[20200616\|16]] | [[20200617\|17]] | [[20200618\|18]] | [[20200619\|19]] | 20 |
| 21 | [[20200622\|22]] | [[20200623\|23]] | [[20200624\|24]] | [[20200625\|25]] | 26 | 27 |
| 28 | [[20200629\|29]] | 30 |  |  |  |  |

Other things of note:

  • Using the YYYYMMDD format for daily notes to match up with the Zettelkasten method of file naming YYYYMMDDHHmm
  • Using internal headings links to create a quick link index at the top of the note. Jump to year then jump to month. This will be critical as time goes by and the length of the file grows.
  • Haven’t implemented weeks into the table views but that’s a good idea.

For the Daily Note itself, I have a template which helps me quickly create links between days and the index. Not quite breadcrumbs level yet.

# Month Day, 2020

___

**[[20200101|Previous Day]] - [[Daily Notes|Index]] - [[20200101|Next Day]]**

___

14 Likes

Thanks for sharing this, the calendar setup is something I needed to get in place.

Also, you can embed notes! I’ve been testing it out and it works well (similar setup to what you’re doing):

![[202007140835]]

That would embed the note when you’re in preview mode. Not sure about checkboxes working, but that would allow you to add as many into one page as needed, and “work” them in their own note.

Edit: I just tried it again but looking at it like a task list - it might take some reformatting/CSS changes to get it to look a little cleaner. Now, if it could query against tags (or other stuff), then it’d be really great

3 Likes

Hi, I liked this idea but wanted a little more customization. In the other similar posts I only saw the generated markdown. So I put together a bash script to generate a calendar view that uses the date format that I specifically use for daily notes (it is customizable). You can also customize the format of the “empty days” in the calendar grid and the table headers among other things.

The bash script can be found here:

and produces something like this:

I tested it on ubuntu but should work on any linux with bash and gnu date command.

NOTE!! It uses the GNU date command - so it doesnt work out of the box on Mac - but if there is interest i can make a mac version also (or you can install gnu date on mac)

I also plan to make dedicated week / month views that embed the daily notes etc. Let me know if there is interest in that and I will share once it is ready.

13 Likes

on MacOS: brew install coreutils will provide GNU Date as gdate

I made a gist of the mac version with date replaced with gdate: https://gist.github.com/chrxn/6f133e283f3a7587231728fd240bc289

2 Likes

This is really helpful, thank you.

I wonder whether someone might be interested in providing a website on which you can generate such outputs (anything related to organising markdown files) independent of OS/platform.

3 Likes

I just found this thread last night and it’s amazing. I am not much of a coder but I figured out how to get this script running in Windows and it’s fantastic. I really appreciate you posting this as it was a major time saver. Thank you!

@chrxn
I wasn’t able to get the script you posted to GitHub to generate the calendars correctly. I did install the gdate but the echo -n commands weren’t really suppressing the newline returns when concatenating the days of the month, empty days, and the week number.

I made the following change. It seems to work correctly for me now. Posting here in case others had trouble with it. Maybe consider updating your code on Github if you experienced a similar issue.

# 2020-07-28 - Mike
#
#   The above change for macOS didn't not output the calendars properly for me. I made the following changes to the script to get the script
#   to produce the correct output.
#
#   Removed -n option from echo commands that needed to concatenate the day entries and added \c to the end of the echo strings.
#   I did this based on the following description for the manpage for echo on macOS:
#
#           -n    Do not print the trailing newline character.  This may also be achieved by appending `\c' to the end of the string, as is
#                 done by iBCS2 compatible systems.  Note that this option as well as the effect of `\c' are implementation-defined in IEEE
#                 Std 1003.1-2001 (``POSIX.1'') as amended by Cor. 1-2002.  Applications aiming for maximum portability are strongly encour-
#                 aged to use printf(1) to suppress the newline character.
#
#

md-cal-macOS-fix-for-newline-supression.sh.zip (2.2 KB)

Maybe we can talk @ryanjamurphy into building a KBM macro to prompt for the date range and the directory where to build the calendar.md file to make this more generic for people to use. Just a thought. He seems to be gathering quite a collection!

Hopefully, this will work for those on macOS that had trouble with the original script.

2 Likes

This script currently only works by running it from the command line, yes? I haven’t had the chance to play with it. If that’s the case building a macro should be trivial, and I can take a look!

1 Like

@ryanjamurphy

I ran it command line to test and pasted it into KMB as a script. It works there too but needs some more useful features. Here is the kmb macro, make it better, please:

Make Calendar.kmmacros.zip (2.9 KB)

Ha, it does work. I am not too familiar with shell scripting so it may take a while for me to revamp anything. I’ll share if/when I make progress!

What other features would you guys like? I may be able to update the original with more options.

@danbburg

Suppose the script knew what directory the daily notes lives in. Once the link is built search that directory to see if a note exists. If it does make that link and its date bold by putting between two asterisks:

1 Like

@danbburg

Also, it seems to me those week numbers can be links to weekly review notes for people that do that sort of thing. And also bold those week numbers if a weekly review note exists.

@ryanjamurphy’s KBM macro can be set to run often enough to keep the calendar current. Like every time the Obsidian window has focus. With The Archive app people often did this to create a tag cloud list and keep it current. It is a bit of a klugy way to keep it updated but until there is a calendar plugin it would do.

I am sure you can do something similar on ubuntu to keep the calendar up to date.

I also like how @matthewpmunger has the year and month header links at the beginning.

That would be “a nice” to have.

Maybe provide a count of daily and weekly notes that you find exists by month and maybe a total at the end. People that do notes love stats.

The more you can automate the less I and maybe others have to fiddle with. Thank you for offering to help.

Great script and a great idea. Thanks.

@Mike

All good ideas. I didn’t get a chance to update with all of them but I did add in the check for whether or not the daily note exists or not. Based on this I added a few options:

  • dailyNotePath : path to daily notes, needed to check file existence
  • checkFileExists : check for file existence or not. if false then it is the same as before. if true then the following options are allowed based on whether a file exists
  • linkNonExisting : if false, then days with non existent daily notes will NOT be made into links. This helps clean up the graph view and differentiate between existing/non-existing notes.
  • hle : highlight characters for existing notes, e.g. if hle="**" then you get **[[ link | display ]]** could also set to “==” to highlight or an emoji to wrap date in a set of emojis
  • hlne : same thing but for non existing files

A few other updates:

  • I am interested in adding some statistics, but for now I just had it print the number of daily notes found in the date range.
  • I also updated it to use printf instead of echo so it should be more portable - no problem with echo -n.
  • I added a variable to control the date executable so that you can easily set it to gdate on OS X
  • I tested this updated version on OS X - but if people find problems let me know.

I’ll try to get to the other features you mentioned when I have more time like linking the week number to a weekly note etc.

The updated version is at the same gist above

For example you can now do something like the following with:
linkNonExisting=false and
hle="**"

2 Likes

Very good. Bravo! :clap: I do hope more people take a look at this and ponder additional options. This seems like a very good prototype proof of concept approach for a calendar daily note plugin.

I did a little testing before breaking for lunch and it worked just as you described on macOS.

I did change the following:

From:
displayFormat="%d"
To
displayFormat="%e"

I am guessing as a default folks might want 1-9 instead of 01-09.
I used %d in the script I posted yesterday but like %e better, the way @matthewpmunger’s displayed.

Here are a few things to consider:

  • Make the name of the file a variable so folks can change the name of the file in one place if they need or want.
  • Also need a path variable for where to write the file. I keep my daily notes in one folder and the index or calendar for them in the root of my vault.
  • Place all the user-configurable variables near the top together in a section so folks won’t need to dig through the source for what they need to change.
  • Would be nice to highlight today’s date by wrapping it with ==.

It would look like this:

I think once you finish, your script will be very useful to many people.
Great idea and nice work.

The customizable script for the calendar looks awesome! Thank you so much for creating and sharing this. :slight_smile:

I personally ran into a problem with formatting the daily note title properly, as I’m currently using the MMMM Do, YYYY format, which has a “-th”, “-nd”, “st” or “-rd” suffix after each day, so I can get titles like “July 23rd, 2020”. I tried looking online but I don’t think they include ordinal suffixes as a formatting option, and I’m not so familiar with bash script. Is there a workaround for this that I don’t know of?

I found this shell scripting tip site for doing original numbers. To use the function it suggests seems doable.

Here is the function it suggests for handling ordinals:

#!/bin/bash

function ordinal () {
  case "$1" in
    *1[0-9] | *[04-9]) echo "$1"th;;
    *1) echo "$1"st;;
    *2) echo "$1"nd;;
    *3) echo "$1"rd;;
  esac
}

I am sure that can be weaved into building the link string by passing it the day of the month.

Do you have the skills for incorporating this into building your link string?

1 Like

hi, I wanna know how to not display these connections between days and calendar in the Graph. I’ve tried script like ‘[[20200604|4]]’ and ‘[23](2020-08-23)’, there always have a line in the Graph.

If you have good method , plz tell me. thx.

1 Like

This kind of filtering is not yet possible. Soon!

1 Like