Adding daily average of pages read -> need date format: day of year

I have a code block for the plugin “Tracker” that takes info from the front matter of my notes on the books I’ve read:

searchType: frontmatter
searchTarget: DateFinished, BookCounter, TotalPages, AudioCounter, TotalLength, Rating
xDataset: 0
folder: /Log/2022
    template: "This year, I've read {{sum(dataset(1))}} books, for a total of {{sum(dataset(2))}} pages. And I've listened to {{sum(dataset(3))}} audiobooks this year, for a total of {{sum(dataset(4))}} hours. The average grade for the overall {{sum(dataset(1))+sum(dataset(3))}} books (and audiobooks) is {{average(dataset(5))}} out of 10."
    style: "font-size:25px;margin-top:00px;"

Now I’d like to add a sentence of the average pages/hours read/listened per day. However, for that I’d need a variable for the day of the year it is. I haven’t gotten an answer on the Tracker github so I though I’d ask here.

My idea was to take the “{{sum(dataset(x))}}” of the TotalPages and divide it through the days of the year; e.g. today is February 1, so it’d be Day 32. But I don’t know/understand if or how I could implement that into the code block, if it’s even possible at all.

It doesn’t need to be with this specific plugin as I’m also having trouble filtering books from audiobooks, so I had to add a second variable (TotalLength) for the hours listened, so I’m open for suggestions.

Any ideas? Thanks :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.