SmartBlocks
SmartBlocks copied to clipboard
Generate multiple date based page links
✂️ Copy of your #42SmartBlock from Roam
-
#42SmartBlock Generate Date links for X days-
<%SET:startingDate,<%INPUT:What is the starting date?%%Today%>%><%NOBLOCKOUTPUT%> -
<%SET:howManyDays,<%INPUT:How many days to generate?%%5%>%><%NOBLOCKOUTPUT%> -
<%JAVASCRIPT:```javascript roam42.sb.vars['dayCounter']=-1```%><%NOBLOCKOUTPUT%> -
<%DATEBASIS:<%GET:startingDate%>%> -
<%REPEAT:<%GET:howManyDays%>%><%DATE:in <%J:return roam42.sb.vars['dayCounter']+=1%> day%> -
-
📋 Describe the SmartBlock
Generates multiple page links, but in the date format of Roam
✅ Describe any prerequisites or dependencies that are required for this SmartBlock
📷 Screenshot of your #42SmartBlock workflow/template from Roam
https://www.loom.com/share/76760b3e8ace49558f54446e892ba9a6
Video in Chinese https://www.loom.com/share/232f57b1fb4d4d6c90918bd4522bfea3

Great explanation on how to generate a list of dates using SmartBlock! I added "How often?" portion to the equation to generate the list of dates for a specific date interval.
-
<%SET:startingDate,<%INPUT:What is the starting date?%%Today%>%><%NOBLOCKOUTPUT%> -
<%SET:howOften,<%INPUT:How often do you want to review?%%5%>%><%NOBLOCKOUTPUT%> -
<%SET:howManyTimes,<%INPUT:How many times to generate?%%5%>%><%NOBLOCKOUTPUT%> -
<%JAVASCRIPT: ```javascript roam42.sb.vars['dayCounter'] = -1;``` %><%NOBLOCKOUTPUT%> -
<%DATEBASIS:<%GET:startingDate%>%> -
<%REPEAT:<%GET:howManyTimes%>%><%DATE:in <%J:return roam42.sb.vars['dayCounter'] += Number(roam42.sb.vars['howOften']); %> day%> -
<%CURSOR%>