RoamJS / workbench

https://roamjs.com/extensions/workbench
The Unlicense
286 stars 35 forks source link

Enhancement request: Ability to write different blocks for each day of the week #338

Closed hawkins closed 3 years ago

hawkins commented 3 years ago

Hey there, new to Roam 42 but love what I'm seeing with Smart Blocks so far! I feel like I'm missing how to do one thing so far though, the ability to write different blocks in a Smart Block workflow for whether it's Wednesday, Friday, etc.

My use case is to have a single daily workflow I can iterate on for content related to every day of the week for use in daily notes pages. I want this workflow to assign different tasks depending on the day of the week, and maybe day of the month, etc. Example tasks:

I don't mean to spell out implementation, but just to give an example of how these might work in case that makes this clearer:

- <% DAYISWEDNESDAY %>
    - {{[[TODO]]}} Laundry
- <% DAYISSATURDAY %>
    - {{[[TODO]]}} Piano lesson
... and perhaps more complicated workflows...
- <% DAYNUMBERTHIRDTHURSDAY %>
    - {{[[TODO]]}} Phone bill

I'd love to know if there's already a way to make this happen, but the closest alternative I've come up with so far is to have a different workflow for each day of the week, i.e., jj Wednesday Daily Notes, where Wednesday Daily Notes has the daily content for that day's tasks, i.e., {{[[TODO]]}} Laundry. This works fine for days of the week, but I'm hoping to have a more powerful way to detect these in a workflow, so I can have one Daily Notes Smart Block that adds different content when needed, i.e., if it's the third Thursday of the month, if it's a Wednesday, if it's the 1st of the month, etc.

hawkins commented 3 years ago

Oh no! I missed IFDAYOFWEEK, IFDAYOFMONTH. I'd still like to figure out something for every N occurrences, like third Thursday of the month, but these two should be largely what I need today. Sorry!!