import { Row, Col, Button } from 'antd'; import { DateElement, FormContextType, GenericObjectType, RJSFSchema, StrictRJSFSchema, TranslatableString, useAltDateWidgetProps, WidgetProps, } from '@rjsf/utils'; export default function AltDateWidget< T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any, >({ autofocus = false, disabled = false, options, readonly = false, time = false, ...props }: WidgetProps) { const { id, name, onBlur, onFocus, registry } = props; const { formContext, translateString } = registry; const { rowGutter = 24 } = formContext as GenericObjectType; const realOptions = { yearsRange: [1900, new Date().getFullYear() + 2], ...options }; const { elements, handleChange, handleClear, handleSetNow } = useAltDateWidgetProps({ ...props, autofocus, options: realOptions, }); return ( {elements.map((elemProps, i) => { const elemId = `${id}_${elemProps.type}`; return ( ); })} {!options.hideNowButton && ( )} {!options.hideClearButton && ( )} ); }