mdelobelle / obsidian_supercharged_links

obsidian plugin to add attributes and context menu options to internal links
MIT License
504 stars 33 forks source link

FR: Show if date link is in the future, today, or past #205

Open axelson opened 10 months ago

axelson commented 10 months ago

I have a feature request, I often use daily notes in my vault and I'd like to change their styling based on if that date is in the past or future.

For example I'd like to be able to do something like if today is 2023-10-22, then a link to 2023-10-23 would show up as red and 2023-10-21 would show up as blue.

As far as I can tell there isn't a way to do this currently. One option would be to add a way to run a javascript function for each link to determine the css class to add, although that would make caching very difficult and might be a big source of bugs.

Does this sound like something that is in scope for the plugin?

HEmile commented 10 months ago

Hmm, yeah this is not static. I guess this should be possible by defining a CSS attribute for the current date, but date comparisons in CSS also sound like a bit of a hassle. I don't think I would work on this in the short term, but feel free to PR.

axelson commented 10 months ago

Hmm, yeah it doesn't seem feasible to accomplish this with CSS alone. But if I think of something I'll work on a PR for it 👍