FR: Fix the `ctime` of .md files based on "Date Created" frontmatter.
See original GitHub issueIs Your Feature Request Related to a Problem? Please Describe.
Yes it is!!
One of the main pain point when migrating from Evernote to Obsidian is that the note’s ctime
can often get lost/modified during syncing – either due to restrictions of sync services like Git (e.g. when i setup a new computer from a obsidian Git repo), or due to OS restrictions (Obsidian Sync cannot preserve file’s ctime on Linux),
To the point that, i cannot reliably view the notes sorted by their “create time” in the Obsidian’s Files Explorer.
Describe the Solution You’d Like
Since Linter already supports the feature to maintain a create timestamp in frontmatter, I wonder if it’d be possible to add a new option use create date YAML to set the ctime
of the file, when they do not match.
Potential name for the new option: Sync "Date Created" to the file `ctime` (when mismatched)
Roughly logic (when the new option is turned on):
- if “Date Created” YAML does NOT exist -> fill it in just like today
- if “Date Created” DOES exist, and when it’s the SAME as the
ctime
of the file -> do nothing - if “Date Created” DOES exist, and is DIFFERENT than the
ctime
of the file -> Update the file’sctime
using the “Date Created” value
Describe Alternatives You’ve Considered
-
Currently, i rely on Dataview to generate a view using the “Date Created” frontmatter value. It works, but is somewhat awkward and requires keeping a separate note per folder that i’m interested in.
It would be MUCH nicer if the sort order by “create time” in File Explorer can be reliably used 😃
-
Alternatively, i could do the above using a custom script, but it would be much nicer if this is built-in into Linter (for batch-fixing all my notes) 😃
Thanks SO much for your considerations! 😃
(credit to @Antisimplistic on Discord for the brilliant idea!! 😃)
Issue Analytics
- State:
- Created a year ago
- Comments:18
Top GitHub Comments
I will close this once I get done with adding the lint all functionality for the custom lint rules. Thus far, I have been really trying to fix bugs and work out custom ignore rules. Hopefully it won’t be too much longer on this.
I was thinkimg some more on this and I am not sure how maintainable that logic would be since it requires upsating file metadata. I am not saying it cannot be done, but testing and making sure it still works would require manual work since we would have to mock how obsidian works.