/** * Date & Time Node - Version 1 * Allows you to manipulate date and time values */ export interface DateTimeV1Params { action?: 'calculate' | 'format' | Expression; /** * The value that should be converted * @displayOptions.show { action: ["format"] } */ value?: string | Expression | PlaceholderValue; /** * Name of the property to which to write the converted date * @displayOptions.show { action: ["format"] } * @default data */ dataPropertyName?: string | Expression | PlaceholderValue; /** * Whether a predefined format should be selected or custom format entered * @displayOptions.show { action: ["format"] } * @default false */ custom?: boolean | Expression; /** * The format to convert the date to * @displayOptions.show { action: ["format"], custom: [true] } */ toFormat?: string | Expression | PlaceholderValue; /** * Options * @displayOptions.show { action: ["format"] } * @default {} */ options?: { /** In case the input format is not recognized you can provide the format */ fromFormat?: string | Expression | PlaceholderValue; /** The timezone to convert from. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>. * @default UTC */ fromTimezone?: string | Expression; /** The timezone to convert to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>. * @default UTC */ toTimezone?: string | Expression; }; /** * Operation * @displayOptions.show { action: ["calculate"] } * @default add */ operation?: 'add' | 'subtract'; /** * E.g. enter “10” then select “Days” if you want to add 10 days to Date Value. * @displayOptions.show { action: ["calculate"] } * @default 0 */ duration?: number | Expression; /** * Time unit for Duration parameter above * @displayOptions.show { action: ["calculate"] } * @default days */ timeUnit?: 'quarters' | 'years' | 'months' | 'weeks' | 'days' | 'hours' | 'minutes' | 'seconds' | 'milliseconds' | Expression; } interface DateTimeV1NodeBase { type: 'n8n-nodes-base.dateTime'; version: 1; } export type DateTimeV1ParamsNode = DateTimeV1NodeBase & { config: NodeConfig; }; export type DateTimeV1Node = DateTimeV1ParamsNode;