|
|
@ -7,6 +7,7 @@ import classNames from 'classnames'; |
|
|
|
import Icon from '../icon'; |
|
|
|
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; |
|
|
|
import interopDefault from '../_util/interopDefault'; |
|
|
|
import { PickerProps } from './createPicker'; |
|
|
|
|
|
|
|
function formatValue(value: moment.Moment | null, format: string): string { |
|
|
|
return (value && value.format(format)) || ''; |
|
|
@ -55,6 +56,12 @@ class WeekPicker extends React.Component<any, WeekPickerState> { |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
componentDidUpdate(prevProps: PickerProps) { |
|
|
|
if ('open' in prevProps && prevProps.open) { |
|
|
|
this.focus(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
weekDateRender = (current: any) => { |
|
|
|
const selectedValue = this.state.value; |
|
|
|
const { prefixCls } = this; |
|
|
@ -90,10 +97,6 @@ class WeekPicker extends React.Component<any, WeekPickerState> { |
|
|
|
if (onOpenChange) { |
|
|
|
onOpenChange(open); |
|
|
|
} |
|
|
|
|
|
|
|
if (!open) { |
|
|
|
this.focus(); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
clearSelection = (e: React.MouseEvent<HTMLElement>) => { |
|
|
|