sawhney17 / logseq-smartblocks

MIT License
171 stars 12 forks source link

Enhancement: Support for "Last day of month" (without using complex control statements) #32

Open Cordelya opened 1 year ago

Cordelya commented 1 year ago

This is an enhancement suggestion. While having this feature would be incredibly useful, I can work around it.

Setting a smartblock to be inserted only on the last day of a month, when months might have 28, 29, 30 or 31 days is tricky.

I could do (I'm using pseudocode, here):

if month = 1, 3, 5, 7, 8, 10, 12 and dayofmonth = 31
  or if month = 4,6,9,11 and dayofmonth = 30
  or if month = 2 and dayofmonth = 28

then do foo...

I could not find anything in the docs or existing issues (closed or open) about this.

My suggestion is to implement if dayofmonth = -1 to select that month's MAX day.

WesHoward commented 1 year ago

big plus one here, this month and next month give me todays date in the respective months. I have a template that I want to insert the last day of the current month or a future month and was frustrated I could not make that reference via NLD.