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

Updated the plain text convertor tool to use lastModified date #9

Merged

Conversation

mplorentz
Copy link
Contributor

When importing my plain text notes I noticed that they all came in with a created and modified dates set to today. This means that when I import them into Standard Notes really old notes show up at the top instead of the most recently edited ones.

This PR changes the plain text convertor to use each file's lastModified date in the created_at and updated_at fields, causing them to be sorted correctly in Standard Notes.

Should I have committed my changes to package-lock.json? I'm not a node guy so I'm not really sure.

@moughxyz
Copy link
Member

Hey @mplorentz, thanks for the PR. lastModified doesn't seem to be standard as part of a file. Were you able to test and confirm that this property was valid? Which OS and browser did you use? Can you try in multiple ones and see if they are also successful?

@mplorentz
Copy link
Contributor Author

@mobitar oh, I didn't realize it wasn't standard. I tested it on macOS in Safari and Firefox, and the lastModified value is read successfully and saved correctly in the sn-import-file.txt. Should I add a fallback to the current date if lastModified is null?

@moughxyz
Copy link
Member

Yes, that would be good. It might just do that anyway if new Date(null) returns current date, but better to test that.

@moughxyz moughxyz merged commit 6690969 into standardnotes:master Dec 15, 2018
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.

None yet

2 participants