diff --git a/Linear.omnifocusjs/Resources/pull.js b/Linear.omnifocusjs/Resources/pull.js index ec73964..2bdf58c 100644 --- a/Linear.omnifocusjs/Resources/pull.js +++ b/Linear.omnifocusjs/Resources/pull.js @@ -27,7 +27,7 @@ /////////////////////////// req.method = "POST"; req.bodyString = - '{"query":"{ viewer { assignedIssues(filter: {state: {type: {nin: [\\"completed\\",\\"canceled\\"]}}}) { nodes { identifier title url team { name } project { name url } } } } }"}'; + '{"query":"{ viewer { assignedIssues(filter: {state: {type: {nin: [\\"completed\\",\\"canceled\\"]}}}) { nodes { identifier title url dueDate team { name } project { name url } } } } }"}'; req.headers = { "Content-Type": "application/json", Authorization: key, @@ -84,6 +84,11 @@ task.appendStringToNote(linearTask.url); } } + if (linearTask.dueDate) { + // set the date but strip off the time component + let date = new Date(linearTask.dueDate); + task.dueDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); + } } if (app.platformName === "macOS") { document.windows[0].perspective = Perspective.BuiltIn.Projects; diff --git a/Linear.omnifocusjs/Resources/pull.ts b/Linear.omnifocusjs/Resources/pull.ts index b0185c5..bd49f1d 100644 --- a/Linear.omnifocusjs/Resources/pull.ts +++ b/Linear.omnifocusjs/Resources/pull.ts @@ -34,7 +34,7 @@ /////////////////////////// req.method = "POST"; req.bodyString = - '{"query":"{ viewer { assignedIssues(filter: {state: {type: {nin: [\\"completed\\",\\"canceled\\"]}}}) { nodes { identifier title url team { name } project { name url } } } } }"}'; + '{"query":"{ viewer { assignedIssues(filter: {state: {type: {nin: [\\"completed\\",\\"canceled\\"]}}}) { nodes { identifier title url dueDate team { name } project { name url } } } } }"}'; req.headers = { "Content-Type": "application/json", Authorization: key, @@ -104,6 +104,18 @@ task.appendStringToNote(linearTask.url); } } + if (linearTask.dueDate) { + // set the date but strip off the time component + let date = new Date(linearTask.dueDate); + task.dueDate = new Date( + date.getFullYear(), + date.getMonth(), + date.getDate(), + 0, + 0, + 0 + ); + } } if (app.platformName === "macOS") {