diff --git a/spiffworkflow-frontend/src/themes/carbon/BaseInputTemplate/BaseInputTemplate.tsx b/spiffworkflow-frontend/src/themes/carbon/BaseInputTemplate/BaseInputTemplate.tsx index 74e7702c1..da4412cc7 100644 --- a/spiffworkflow-frontend/src/themes/carbon/BaseInputTemplate/BaseInputTemplate.tsx +++ b/spiffworkflow-frontend/src/themes/carbon/BaseInputTemplate/BaseInputTemplate.tsx @@ -9,6 +9,7 @@ import { } from '@rjsf/utils'; import { useCallback } from 'react'; +import { DATE_FORMAT, DATE_FORMAT_CARBON } from '../../../config'; /** The `BaseInputTemplate` is the template to use to render the basic `` component for the `core` theme. * It is used as the template for rendering many of the based widgets that differ by `type` and callbacks only. @@ -105,13 +106,13 @@ export default function BaseInputTemplate< if (type === 'date') { component = ( ); diff --git a/spiffworkflow-frontend/src/themes/carbon/DateWidget/DateWidget.tsx b/spiffworkflow-frontend/src/themes/carbon/DateWidget/DateWidget.tsx index a5ee5f170..91846dfc4 100644 --- a/spiffworkflow-frontend/src/themes/carbon/DateWidget/DateWidget.tsx +++ b/spiffworkflow-frontend/src/themes/carbon/DateWidget/DateWidget.tsx @@ -1,24 +1,19 @@ -import React from 'react'; +import React, { useCallback } from 'react'; import { getTemplate, WidgetProps } from '@rjsf/utils'; function DateWidget(props: WidgetProps) { - const { options, registry } = props; + const { onChange, options, registry } = props; const BaseInputTemplate = getTemplate<'BaseInputTemplate'>( 'BaseInputTemplate', registry, options ); - - return ( - + const handleChange = useCallback( + (value: any) => onChange(value || undefined), + [onChange] ); + + return ; } export default DateWidget;