-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Date & Time Node): Dont parse date if it's not set (null or undef…
…ined) (#7050) Github issue / Community forum post (link here to close automatically): https://community.n8n.io/t/date-time-node-transforming-null-to-19700101/29339 null/undefined input was converted to 01/01/1970 instead of being passed through as-is
- Loading branch information
Showing
2 changed files
with
108 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
packages/nodes-base/nodes/DateTime/test/node/workflow.nullDate_v2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{ | ||
"name": "Null Date", | ||
"nodes": [ | ||
{ | ||
"parameters": {}, | ||
"id": "62bb450c-f2e3-41c9-9894-a954d2c5e115", | ||
"name": "When clicking \"Execute Workflow\"", | ||
"type": "n8n-nodes-base.manualTrigger", | ||
"typeVersion": 1, | ||
"position": [ | ||
1600, | ||
740 | ||
] | ||
}, | ||
{ | ||
"parameters": { | ||
"jsCode": "return {date: null}" | ||
}, | ||
"id": "47e4ce5b-2365-4987-a058-ae21964d135d", | ||
"name": "Code", | ||
"type": "n8n-nodes-base.code", | ||
"typeVersion": 2, | ||
"position": [ | ||
1820, | ||
740 | ||
] | ||
}, | ||
{ | ||
"parameters": { | ||
"operation": "formatDate", | ||
"date": "={{ $json.date }}", | ||
"options": {} | ||
}, | ||
"id": "9af21b91-9db6-40cd-98ee-ee969eb0a348", | ||
"name": "Date & Time", | ||
"type": "n8n-nodes-base.dateTime", | ||
"typeVersion": 2, | ||
"position": [ | ||
2040, | ||
740 | ||
] | ||
} | ||
], | ||
"pinData": { | ||
"Date & Time": [ | ||
{ | ||
"json": { | ||
"formattedDate": null | ||
} | ||
} | ||
], | ||
"Code": [ | ||
{ | ||
"json": { | ||
"date": null | ||
} | ||
} | ||
] | ||
}, | ||
"connections": { | ||
"When clicking \"Execute Workflow\"": { | ||
"main": [ | ||
[ | ||
{ | ||
"node": "Code", | ||
"type": "main", | ||
"index": 0 | ||
} | ||
] | ||
] | ||
}, | ||
"Code": { | ||
"main": [ | ||
[ | ||
{ | ||
"node": "Date & Time", | ||
"type": "main", | ||
"index": 0 | ||
} | ||
] | ||
] | ||
} | ||
}, | ||
"active": false, | ||
"settings": { | ||
"executionOrder": "v1" | ||
}, | ||
"versionId": "", | ||
"meta": { | ||
"instanceId": "78577815012af39cf16dad7a787b0898c42fb7514b8a7f99b2136862c2af502c" | ||
}, | ||
"tags": [] | ||
} |