standardnotes / sntools

Evernote converter and other tools
GNU Affero General Public License v3.0
18 stars 12 forks source link

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

Closed mplorentz closed 5 years ago

mplorentz commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

@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 commented 5 years ago

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