beaussan / update-time-on-edit-obsidian

MIT License
165 stars 15 forks source link

Adds setting to use numeric date properties #67

Closed ygormutti closed 8 months ago

ygormutti commented 9 months ago

Why is this PR necessary?

Other PKM tools may save the created/updated properties as numbers instead of strings when using numeric date formats like (milli)seconds since Unix epoch.

This plugin is very useful for maintaining the date properties while using multiple tools to manage the same vault. Unfortunately, in the scenario above it's assigning a string to property that is already recognized by Obsidian as a number, so an annoying :warning: sign will appear every time the user edit the note, until they have changed the property to string on all notes and stop using other tools.

image

What does it do?

This PR adds a new setting, disabled by default, that users can enable to make the plugin assign numbers to created/updated in case the format is numeric, improving compatibility with other tools.

Notes

I'm a Dendron user on desktop and former GitJournal user on Android migrating to Obsidian + Obsidian Git plugin.

I realize this is a very specific use case, but I hope it can be useful to others so it can be merged back into the upstream. From my tests, the plugin is working exactly as I intended when using my fork

beaussan commented 9 months ago

Seems good to me! I'll make a proper review and some tests tomorrow to ensure everything is good!

One thing you could add is a note on the readme that I can so that, otherwise the code looks good to me! Thanks a lot for the contribution

ygormutti commented 9 months ago

Thank you! I've added a bullet point to README mentioning this new feature

ygormutti commented 8 months ago

PS: I've created a 2.5.0 release on my fork containing just this change, so anyone who wants to try it using BRAT can use the following URL: https://github.com/ygormutti/update-time-on-edit-obsidian.git