diff --git a/spiffworkflow-frontend/package-lock.json b/spiffworkflow-frontend/package-lock.json index a283617a..70463c7a 100644 --- a/spiffworkflow-frontend/package-lock.json +++ b/spiffworkflow-frontend/package-lock.json @@ -50052,7 +50052,7 @@ "@csstools/postcss-text-decoration-shorthand": "^1.0.0", "@csstools/postcss-trigonometric-functions": "^1.0.2", "@csstools/postcss-unset-value": "^1.0.2", - "autoprefixer": "^10.4.13", + "autoprefixer": "10.4.5", "browserslist": "^4.21.4", "css-blank-pseudo": "^3.0.3", "css-has-pseudo": "^3.0.4", @@ -50090,7 +50090,8 @@ }, "dependencies": { "autoprefixer": { - "version": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.5.tgz", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.5.tgz", "integrity": "sha512-Fvd8yCoA7lNX/OUllvS+aS1I7WRBclGXsepbvT8ZaPgrH24rgXpZzF0/6Hh3ZEkwg+0AES/Osd196VZmYoEFtw==", "requires": { "browserslist": "^4.20.2", diff --git a/spiffworkflow-frontend/src/helpers.tsx b/spiffworkflow-frontend/src/helpers.tsx index 86b074b3..7ea6f86e 100644 --- a/spiffworkflow-frontend/src/helpers.tsx +++ b/spiffworkflow-frontend/src/helpers.tsx @@ -71,9 +71,6 @@ export const convertDateObjectToFormattedString = (dateObject: Date) => { }; export const dateStringToYMDFormat = (dateString: string) => { - if (dateString.length < 10) { - return dateString; - } if (DATE_FORMAT.startsWith('dd')) { const d = dateString.split('-'); return `${d[2]}-${d[1]}-${d[0]}`; @@ -107,12 +104,15 @@ export const convertDateAndTimeStringsToSeconds = ( }; export const convertStringToDate = (dateString: string) => { - return convertDateAndTimeStringsToSeconds(dateString, '00:10:00'); + return convertDateAndTimeStringsToDate(dateString, '00:10:00'); }; export const ymdDateStringToConfiguredFormat = (dateString: string) => { const dateObject = convertStringToDate(dateString); - return convertDateObjectToFormattedString(dateObject); + if (dateObject) { + return convertDateObjectToFormattedString(dateObject); + } + return null; }; export const convertSecondsToDateObject = (seconds: number) => { @@ -155,7 +155,10 @@ export const convertSecondsToFormattedDateString = (seconds: number) => { export const convertDateStringToSeconds = (dateString: string) => { const dateObject = convertStringToDate(dateString); - return convertDateToSeconds(dateObject); + if (dateObject) { + return convertDateToSeconds(dateObject); + } + return null; }; export const objectIsEmpty = (obj: object) => { diff --git a/spiffworkflow-frontend/src/themes/carbon/BaseInputTemplate/BaseInputTemplate.tsx b/spiffworkflow-frontend/src/themes/carbon/BaseInputTemplate/BaseInputTemplate.tsx index 19d93bd7..61fcce93 100644 --- a/spiffworkflow-frontend/src/themes/carbon/BaseInputTemplate/BaseInputTemplate.tsx +++ b/spiffworkflow-frontend/src/themes/carbon/BaseInputTemplate/BaseInputTemplate.tsx @@ -102,7 +102,11 @@ export default function BaseInputTemplate< // it should in be y-m-d when it gets here. let dateValue: string | null = ''; if (value || value === 0) { - dateValue = ymdDateStringToConfiguredFormat(value); + if (value.length < 10) { + dateValue = value; + } else { + dateValue = ymdDateStringToConfiguredFormat(value); + } } component = (