argenos / nldates-obsidian

Work with dates in natural language in Obsidian

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow for custom offsets for natural language dates with day names

kankaristo opened this issue · comments

This is an extremely useful plugin, but it handles day names a bit wrong for the way I think.

Some examples of how the plugin works, and how I think about dates:

Input Plugin My mind
@Friday the Friday before today (same as "this Friday") the Friday after today (same as "this Friday")
@this Friday the Friday before today the Friday after today
@last Friday one week before the Friday before today the Friday before today
@next Friday the Friday after today the next Friday after "this Friday"

Maybe I'm alone in this, but that's the way I think about those. I generally use future dates a lot more than past dates, whereas the plugin seems to do the opposite.

Right now, I can't really "trust" the plugin to insert the correct date, because:

  • I input a natural language date
  • the plugin replaces it with a date
  • I have to look it up in a calendar to check that it's correct
    • I might have as well looked up the date in the calendar in the first place ¯\_(ツ)_/¯

So, it would be great if the plugin allowed for customization for these phrases. For the above examples, it actually looks like there's exactly a 1 week offset between those, so that would work for me, but more customization is always better.


Or alternatively, if the plugin had e.g. @+Friday (Friday after today) and @-Friday (Friday before today), they would be completely unambiguous, although not quite as "natural".

You could even "chain" those and do something like @+Friday+7 (Friday after today plus 7 days) or @-Friday-week (Friday before today minus 1 week). But maybe these are past the point of the plugin, since they're not as natural.

Hi, thanks for the request. I just wanted to clarify exactly what the plugin is doing to interpret next, this, and last (though I'm not defending the behavior)

  • This Friday - the plugin actually checks for the closest Friday, either upcoming or past.
  • Next Friday - 7 days after This Friday
  • Last Friday - 7 days before This Friday

Ah okay, good to know. The ones I have above were just based on quickly testing how the plugin behaves, I didn't actually check the documentation or code. 😅

To me "(this) Friday" is always either today (if it's Friday), or the Friday after today. If yesterday was Friday, it's already "last Friday" to me. "Next Friday" is sometimes a bit blurry; in conversation I would probably say "Friday a week from now", if I don't mean the very next Friday after today.

But to most people "(this) Friday" might be the "closest" Friday, like the plugin currently understands it, I'm not sure. Might also depend on where you're from (I'm from Finland), your native language, etc., localization is difficult. I don't care what the default is, if it would be configurable to what's "natural" for the particular user. 😛

hmm.. I guess the best way would be an option.
THIS means nearest (past or future) day = True (default) as it is the behavior now
THIS means next future day = False

And btw: THIS atm isn't working correctly. Today is Tuesday and my THIS Thursday is last week 😞