diff --git a/src/PickerInput/SinglePicker.tsx b/src/PickerInput/SinglePicker.tsx index 9fe862d84..11af70f28 100644 --- a/src/PickerInput/SinglePicker.tsx +++ b/src/PickerInput/SinglePicker.tsx @@ -99,7 +99,9 @@ export interface BasePickerProps export interface PickerProps extends BasePickerProps, - Omit, 'format' | 'defaultValue'> {} + Omit, 'format' | 'defaultValue'> { + getNow?: () => string; +} /** Internal usage. For cross function get same aligned props */ export type ReplacedPickerProps = { diff --git a/src/PickerInput/hooks/useFilledProps.ts b/src/PickerInput/hooks/useFilledProps.ts index 5b562f61c..3da44ddd4 100644 --- a/src/PickerInput/hooks/useFilledProps.ts +++ b/src/PickerInput/hooks/useFilledProps.ts @@ -41,6 +41,7 @@ type PickedProps = Pick< defaultValue?: any; pickerValue?: any; defaultPickerValue?: any; + getNow?: () => string; }; type ExcludeBooleanType = T extends boolean ? never : T; @@ -161,6 +162,10 @@ export default function useFilledProps< const filledProps = React.useMemo( () => ({ ...props, + generateConfig: { + ...generateConfig, + getNow: props.getNow || props.generateConfig.getNow, + }, prefixCls, locale: mergedLocale, picker,