mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
⚡ Fix date of birth fields
This commit is contained in:
parent
15b8db75d8
commit
c404f86e38
|
@ -130,8 +130,15 @@ const adjustMailingAddressFields = adjustLocationFields('Mailing_Address');
|
|||
const adjustShippingAddressFields = adjustLocationFields('Shipping_Address');
|
||||
const adjustOtherAddressFields = adjustLocationFields('Other_Address');
|
||||
|
||||
const adjustDateOfBirth = (allFields: { Date_of_Birth: string }) => {
|
||||
if (!allFields.Date_of_Birth) return allFields;
|
||||
allFields.Date_of_Birth = allFields.Date_of_Birth.split('T')[0];
|
||||
|
||||
return allFields;
|
||||
};
|
||||
|
||||
export const adjustAccountFields = flow(adjustBillingAddressFields, adjustShippingAddressFields);
|
||||
export const adjustContactFields = flow(adjustMailingAddressFields, adjustOtherAddressFields);
|
||||
export const adjustContactFields = flow(adjustMailingAddressFields, adjustOtherAddressFields, adjustDateOfBirth);
|
||||
export const adjustInvoiceFields = flow(adjustBillingAddressFields, adjustShippingAddressFields); // TODO: product details
|
||||
export const adjustLeadFields = adjustAddressFields;
|
||||
export const adjustPurchaseOrderFields = adjustInvoiceFields;
|
||||
|
|
|
@ -109,7 +109,7 @@ export const contactFields = [
|
|||
{
|
||||
displayName: 'Date of Birth',
|
||||
name: 'Date_of_Birth',
|
||||
type: 'string',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
|
@ -319,7 +319,7 @@ export const contactFields = [
|
|||
{
|
||||
displayName: 'Date of Birth',
|
||||
name: 'Date_of_Birth',
|
||||
type: 'string',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue