Two Obsidian bases tips
There are two things that made me spend some time right after the release of the new core plugin bases, for Obsidian.
Review Cycle and When to Review
One of them is calculating a review date based on my review cycle for some of my existing notes.
The issue is mostly due to my usage of ISO-86O1 timestamps. I had to clean up things so that bases correctly understood the timestamp and applied the duration until the review date becomes the actual date.
Here I have a modified
property with an ISO-86O1 timestamps in the format YYYY-MM-DD[T]HH:mm:ssZZ
.
The main points here are:
- Remove the
T
and - Remove the timezone
This is done by the following code:
base date(modified.toString().replace('T',' ').slice(0, -5))+reviewCycle
In it, I convert the timestamp to a string so that I can use string functions and then I convert it back to a date, after removing the timezone and the “T” separating the date and the time in the note.
Accessing a subproperty
The second issue I had was showing my books notes with the existing Kindle highlights plugin.
Here, I've opted to make it explicit that I'll be dealing with the note properties instead of letting it implicit. The main reason for that was that I was unsure about the property name, so…
Here it is the code for the number of highlight I have
base note["kindle-sync"].highlightsCount
And I used something similar while at the cards view for my book covers.
I hope those help some people.