Open JasperGeh opened 3 years ago
Hi Jasper, thank you for this smartblock. great feature! I am receiving the wrong color for 10:58 AM is blue - should be olive note: I am using the Roam Colored Font alternative https://gist.github.com/ciceronianus/21f3c7f88efb9d515377ad3c3e09dca6
pls let me know if you can think of a fix for this, thanks!
You're right, I had a typo in the olive block and set the colour for times between dayjs().hour() >= 13 && dayjs().hour() < 12)
, which obviously fails. I corrected it to >=10 && <12.
Thanks for catching that!
✂️ Copy of your #42SmartBlock from Roam
#42SmartBlock Timestamp
<%IFTRUE:(dayjs().hour() >= 5 && dayjs().hour() < 8)%><%SET:timecolour,blue%><%NOBLOCKOUTPUT%>
<%IFTRUE:(dayjs().hour() >= 8 && dayjs().hour() < 10)%><%SET:timecolour,teal%><%NOBLOCKOUTPUT%>
<%IFTRUE:(dayjs().hour() >= 10 && dayjs().hour() < 12)%><%SET:timecolour,olive%><%NOBLOCKOUTPUT%>
<%IFTRUE:(dayjs().hour() == 12)%><%SET:timecolour,green%><%NOBLOCKOUTPUT%>
<%IFTRUE:(dayjs().hour() >= 13 && dayjs().hour() < 15)%><%SET:timecolour,yellow%><%NOBLOCKOUTPUT%>
<%IFTRUE:(dayjs().hour() >= 15 && dayjs().hour() < 17)%><%SET:timecolour,orange%><%NOBLOCKOUTPUT%>
<%IFTRUE:(dayjs().hour() >= 17 && dayjs().hour() < 19)%><%SET:timecolour,red%><%NOBLOCKOUTPUT%>
<%IFTRUE:(dayjs().hour() >= 19 && dayjs().hour() < 21)%><%SET:timecolour,purple%><%NOBLOCKOUTPUT%>
<%IFTRUE:(dayjs().hour() >= 21 && dayjs().hour() < 23)%><%SET:timecolour,maroon%><%NOBLOCKOUTPUT%>
<%IFTRUE:(dayjs().hour() >= 23 || dayjs().hour() < 5)%><%SET:timecolour,navy%><%NOBLOCKOUTPUT%>
#rm-c:<%GET:timecolour%>**<%TIME%>**
<%CURSOR%>
📋 Describe the SmartBlock
Inserts a timestamp, colour-formatted according to the current time of day, and an empty block nested underneath, ready to be filled with insight. I like to see the passage of time – from light blue to dark red – on my daily notes page.
✅ Describe any prerequisites or dependencies that are required for this SmartBlock
Requires Cato Minor's coloured text CSS. Cato's tags are
#c:color**Text**
, I addedrm-
in front of my tags, as you can see in the second to last block. Change according to your preferred tag-structure📷 Screenshot of your #42SmartBlock workflow/template from Roam
💡 Additional Info
Colours
Example on my DNP