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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix notes without 'updated' field having their update time set to null #8

Merged
merged 1 commit into from
Aug 21, 2018
Merged

Conversation

spookyuser
Copy link
Contributor

Notes without 'updated' fields are currently set to null, and when read in
standard notes this is converted to the unix epoch start. This will set
'updated' to the 'created' field when 'updated' is null.

For example:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export2.dtd">
<en-export export-date="20180819T181512Z" application="Evernote" version="6.x">
<note><title>title</title><content><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">

<en-note><div>note</div></en-note>]]></content><created>20180819T181427Z</created><note-attributes><author>me</author><source>source</source><source-application>evernote</source-application></note-attributes></note></en-export>

Is currently converted to:

{
  "items": [
    {
      "created_at": "2018-08-19T18:14:27.000Z",
      "updated_at": null,
      "uuid": "4510b77c-51ab-4ee7-9510-3955a07b2e81",
      "content_type": "Note",
      "content": {
        "title": "title",
        "text": "note",
        "references": []
      }
    },
    {
      "uuid": "eac6cae6-d814-4aeb-861f-fe53b87f8376",
      "content_type": "Tag",
      "content": {
        "title": "evernote",
        "references": [
          {
            "content_type": "Note",
            "uuid": "4510b77c-51ab-4ee7-9510-3955a07b2e81"
          }
        ]
      }
    }
  ]
}

Which in standard notes makes the highlighted date appear as 1970-01-01. This just assumes the updated date to be the created date, if it's null.

馃槃

Notes without 'updated' fields are currently set to null, and when read in
standard notes this is converted to the unix epoch start. This will set
'updated' to the 'created' field when 'updated' is null.
@moughxyz moughxyz merged commit d339e91 into standardnotes:master Aug 21, 2018
@moughxyz
Copy link
Member

Great, thanks for this!

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