mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Wait Node): Account for workflow timezone in Wait node datetime (#8578)
Co-authored-by: Omar Ajoue <krynble@gmail.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { DateTime } from 'luxon';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
INodeExecutionData,
|
||||
@@ -29,7 +30,6 @@ import {
|
||||
} from '../Form/common.descriptions';
|
||||
import { formWebhook } from '../Form/utils';
|
||||
import { updateDisplayOptions } from '../../utils/utilities';
|
||||
|
||||
import { Webhook } from '../Webhook/Webhook.node';
|
||||
|
||||
const waitTimeProperties: INodeProperties[] = [
|
||||
@@ -420,12 +420,17 @@ export class Wait extends Webhook {
|
||||
|
||||
waitAmount *= 1000;
|
||||
|
||||
// Timezone does not change relative dates, since they are just
|
||||
// a number of seconds added to the current timestamp
|
||||
waitTill = new Date(new Date().getTime() + waitAmount);
|
||||
} else {
|
||||
// resume: dateTime
|
||||
const dateTime = context.getNodeParameter('dateTime', 0) as string;
|
||||
const dateTimeStr = context.getNodeParameter('dateTime', 0) as string;
|
||||
|
||||
waitTill = new Date(dateTime);
|
||||
waitTill = DateTime.fromFormat(dateTimeStr, "yyyy-MM-dd'T'HH:mm:ss", {
|
||||
zone: context.getTimezone(),
|
||||
})
|
||||
.toUTC()
|
||||
.toJSDate();
|
||||
}
|
||||
|
||||
const waitValue = Math.max(waitTill.getTime() - new Date().getTime(), 0);
|
||||
|
||||
Reference in New Issue
Block a user