From 119989bc3760b9a8b1a1e57bfa25c23e657e647a Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 26 Oct 2021 11:32:54 -0500 Subject: [PATCH] :zap: Add support for moment types to If Node --- packages/nodes-base/nodes/If.node.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/nodes-base/nodes/If.node.ts b/packages/nodes-base/nodes/If.node.ts index 2a2a3bd0bd..5a89f07a10 100644 --- a/packages/nodes-base/nodes/If.node.ts +++ b/packages/nodes-base/nodes/If.node.ts @@ -1,3 +1,4 @@ +import moment = require('moment'); import { IExecuteFunctions } from 'n8n-core'; import { INodeExecutionData, @@ -333,6 +334,8 @@ export class If implements INodeType { returnValue = new Date(value).getTime(); } else if (typeof value === 'number') { returnValue = value; + } if (moment.isMoment(value)) { + returnValue = value.unix(); } if ((value as unknown as object) instanceof Date) { returnValue = (value as unknown as Date).getTime(); }