Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to keep timestamps of the original Bear notes #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bernardoamc
Copy link
Owner

This will allow users to still see the expected order of their files based on the modified date when migrating to Obsidian.

See #9

This will allow users to still see the expected order of their files
based on the modified date when migrating to Obsidian.
@bernardoamc
Copy link
Owner Author

@coding-camel Do you have time to see if this fully (or partially) solves the timestamp issues? If so, I will adjust tests and merge the PR so everyone can enjoy a better migration process. :)

@rookbreezy
Copy link

rookbreezy commented Mar 6, 2023

@bernardoamc

I tested this pr today, If a note was created at 12:40 and modified at 12:41.

Running the script at 12:43 makes it created at 12:41 and modified time of 12:41

So keeps the modified date. But loses the created date, which is the most important in my opinion.

@bernardoamc
Copy link
Owner Author

@coding-camel Thanks for taking a look! I will spend some time playing with it to see what can be done, we are moving in the right direction. 😄

@DraconMarius
Copy link

Hey there, hope no one minds me jumping in!

I ran into the same problem with the created timestamp when I tried to build a similar script in node.js. From my research it seems like you can't preserve or overwrite created value if we are copying the file over.

I sorta worked around it, but with a caveat:

To keep all of the original timestamps, I ended up storing the edited time first, then make all of the formatting changes directly to the original file in the Bear folder and move it over to preserve the files's created time. Lastly we write the original edited value back b/c we made those formatting changes directly to the original files.

The catch is that my solution requires the file itself to move. It only really worked because I only wanted the first tag to create the folder structure, instead of duplicating notes for each tag in a note. I'm not 100% sure how to implement that if we need to duplicate the notes for all of the tags within but hope it helps!

@bernardoamc
Copy link
Owner Author

@DraconMarius Thank you for the insights, I really appreciate it! This is a fun problem to tackle.

I've been struggling to find time to make the necessary changes, but I'm totally open to incorporate those changes if anyone would like to take a stab at it. I also hope I can find more time soon to improve a few things in the code. 😄

@DraconMarius
Copy link

@bernardoamc Of course no problem at all! I was tunnel visioned on that problem for far too long haha.

I don't know anything about ruby but will definitely take a stab at it one of these days too :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants