mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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 adjustShippingAddressFields = adjustLocationFields('Shipping_Address');
|
||||||
const adjustOtherAddressFields = adjustLocationFields('Other_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 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 adjustInvoiceFields = flow(adjustBillingAddressFields, adjustShippingAddressFields); // TODO: product details
|
||||||
export const adjustLeadFields = adjustAddressFields;
|
export const adjustLeadFields = adjustAddressFields;
|
||||||
export const adjustPurchaseOrderFields = adjustInvoiceFields;
|
export const adjustPurchaseOrderFields = adjustInvoiceFields;
|
||||||
|
|
|
@ -109,7 +109,7 @@ export const contactFields = [
|
||||||
{
|
{
|
||||||
displayName: 'Date of Birth',
|
displayName: 'Date of Birth',
|
||||||
name: 'Date_of_Birth',
|
name: 'Date_of_Birth',
|
||||||
type: 'string',
|
type: 'dateTime',
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -319,7 +319,7 @@ export const contactFields = [
|
||||||
{
|
{
|
||||||
displayName: 'Date of Birth',
|
displayName: 'Date of Birth',
|
||||||
name: 'Date_of_Birth',
|
name: 'Date_of_Birth',
|
||||||
type: 'string',
|
type: 'dateTime',
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue