alangrainger / obsidian-frontmatter-modified-date

Automatically update a frontmatter/YAML modified date field
MIT License
63 stars 10 forks source link

Feature Request: Date Link Support #22

Closed bgk0018 closed 1 month ago

bgk0018 commented 6 months ago

Hey thanks for this plugin!

I wanted to see if it would be possible to add link support for dates. I prefer to have the date linked for create/update stamps instead of just flat text.

image

I found that if I gave the following moment.js format it created the shape I wanted:

[[[]YYYY-MM-DD[]]]

But unfortunately is considered an invalid date and so when doing a comparison, it just always appends every 10 seconds as line 147 always returns false:

now.isSame(previousEntryMoment, this.settings.appendMaximumFrequency)

image

The only way I could think to implement would be have a toggle for dates-as-links or something which would just concat onto the entries, and peel them off when having to re-parse.

Let me know if this is something you'd be open to adding, I may just do it myself locally.

torrus-dev commented 5 months ago

I found two workarrounds for this issue:

You can escape characters using \ so using \[\[YYYY-MM-DD\]\] will work to create links

Also if you use obsidian date property type it shows a link icon for dates automatically

alangrainger commented 1 month ago

Hi @bgk0018 - just use the standard MomentJS date format to add the extra non-date characters ([[ and ]]), and your dates will show as links.

Set your date format in the plugin settings to be:

[[[]YYYY-MM-DD[]]]