n8n/packages/nodes-base/nodes/DateTime/V2/CurrentDateDescription.ts
Michael Kret aea3c50131
feat(Date & Time Node): Option to include other fields in output item (#7661)
Github issue / Community forum post (link here to close automatically):
Community:
https://community.n8n.io/t/date-time-deletes-incoming-props/27492/3
GH Issue: https://github.com/n8n-io/n8n/issues/7646

---------

Co-authored-by: Marcus <marcus@n8n.io>
2023-11-09 17:57:33 +02:00

67 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { INodeProperties } from 'n8n-workflow';
import { includeInputFields } from './common.descriptions';
export const CurrentDateDescription: INodeProperties[] = [
{
displayName:
'You can also refer to the current date in n8n expressions by using <code>{{$now}}</code> or <code>{{$today}}</code>. <a target="_blank" href="https://docs.n8n.io/code-examples/expressions/luxon/">More info</a>',
name: 'notice',
type: 'notice',
default: '',
displayOptions: {
show: {
operation: ['getCurrentDate'],
},
},
},
{
displayName: 'Include Current Time',
name: 'includeTime',
type: 'boolean',
default: true,
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
description: 'When deactivated, the time will be set to midnight',
displayOptions: {
show: {
operation: ['getCurrentDate'],
},
},
},
{
displayName: 'Output Field Name',
name: 'outputFieldName',
type: 'string',
default: 'currentDate',
description: 'Name of the field to put the output in',
displayOptions: {
show: {
operation: ['getCurrentDate'],
},
},
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Option',
displayOptions: {
show: {
operation: ['getCurrentDate'],
},
},
default: {},
options: [
includeInputFields,
{
displayName: 'Timezone',
name: 'timezone',
type: 'string',
placeholder: 'America/New_York',
default: '',
description:
'The timezone to use. If not set, the timezone of the n8n instance will be used. Use GMT for +00:00 timezone.',
},
],
},
];