Created
June 14, 2019 08:07
-
-
Save parwatcodes/5af5b1fbad1aab56ca3e2b7df13cb0a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getInitialValues = props => { | |
const {company} = props | |
const filteredData = {...company} | |
if (company && company.companyCategory) { | |
const { | |
companyCategory: {id}, | |
} = company | |
delete filteredData.companyCategory | |
filteredData.companyCategoryId = parseInt(id, 10) | |
} | |
if (company && company.established) { | |
const {established} = company | |
const parsedDate = parseISO(established, 'MM/DD/YYYY') | |
filteredData.established = parsedDate | |
} | |
if (company && company.companyEvent) { | |
const {companyEvent} = company | |
filteredData.companyEvent = validateTime(companyEvent) | |
} | |
return filteredData | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment