1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 02:19:55 +00:00

Merge pull request #2275 from Marxsal/patch-9

ENEX import - Apply modified (updated) dates
This commit is contained in:
Jeremy Ruston 2016-02-16 16:24:45 +00:00
commit 7ea3ef7062

View File

@ -38,11 +38,19 @@ exports["application/enex+xml"] = function(text,fields) {
title: getTextContent(noteNode,"title"),
type: "text/html",
tags: [],
text: getTextContent(noteNode,"content")
text: getTextContent(noteNode,"content"),
modified: getTextContent(noteNode,"created").replace("T","").replace("Z",""),
created: getTextContent(noteNode,"created").replace("T","").replace("Z","")
};
$tw.utils.each(noteNode.querySelectorAll("tag"),function(tagNode) {
result.tags.push(tagNode.textContent);
});
// If there's an update date, set modifiy date accordingly
$tw.utils.each(noteNode.querySelectorAll("updated"),function(modifiedNode) {
result["modified"] = modifiedNode.textContent.replace("T","").replace("Z","") + "000" ;
});
$tw.utils.each(noteNode.querySelectorAll("note-attributes"),function(attrNode) {
result[attrNode.tagName] = attrNode.textContent;
});