Browse Source

type: TimePicker added hourStep type (#40947)

pull/40951/head 5.2.3
rgumzej 2 years ago
committed by GitHub
parent
commit
c89640d843
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      components/date-picker/generatePicker/index.tsx
  2. 4
      components/time-picker/demo/interval-options.tsx

6
components/date-picker/generatePicker/index.tsx

@ -72,15 +72,19 @@ export function getTimeProps<DateType, DisabledTime>(
const DataPickerPlacements = ['bottomLeft', 'bottomRight', 'topLeft', 'topRight'] as const;
type DataPickerPlacement = typeof DataPickerPlacements[number];
const HourStep = [0.5, 1, 1.5, 2, 3, 4, 6, 8, 12] as const;
type THourStep = typeof HourStep[number];
type InjectDefaultProps<Props> = Omit<
Props,
'locale' | 'generateConfig' | 'hideHeader' | 'components'
'locale' | 'generateConfig' | 'hideHeader' | 'components' | 'hourStep'
> & {
locale?: PickerLocale;
size?: SizeType;
placement?: DataPickerPlacement;
bordered?: boolean;
status?: InputStatus;
hourStep?: THourStep;
};
export type PickerLocale = {

4
components/time-picker/demo/interval-options.tsx

@ -1,6 +1,6 @@
import React from 'react';
import { TimePicker } from 'antd';
import React from 'react';
const App: React.FC = () => <TimePicker minuteStep={15} secondStep={10} />;
const App: React.FC = () => <TimePicker minuteStep={15} secondStep={10} hourStep={1} />;
export default App;

Loading…
Cancel
Save