File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
apps/copilots/src/pages/copilot-request-form
libs/ui/lib/components/form/form-groups/form-input/input-date-picker Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -394,6 +394,10 @@ const CopilotRequestForm: FC<{}> = () => {
394
394
error = { formErrors . startDate }
395
395
dirty
396
396
minDate = { new Date ( ) }
397
+ maxDate = { new Date ( new Date ( )
398
+ . setFullYear ( new Date ( )
399
+ . getFullYear ( ) + 2 ) ) }
400
+ minYear = { new Date ( ) }
397
401
/>
398
402
< p className = { styles . formRow } > How many weeks will you need the copilot for?</ p >
399
403
< InputText
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ interface InputDatePickerProps {
26
26
readonly maxTime ?: Date | undefined
27
27
readonly minDate ?: Date | null | undefined
28
28
readonly minTime ?: Date | undefined
29
+ readonly minYear ?: Date | null | undefined
29
30
readonly placeholder ?: string
30
31
readonly showMonthPicker ?: boolean
31
32
readonly showYearPicker ?: boolean
@@ -76,7 +77,8 @@ const InputDatePicker: FC<InputDatePickerProps> = (props: InputDatePickerProps)
76
77
const datePickerRef = useRef < ReactDatePicker < never , undefined > > ( null )
77
78
const years = useMemo ( ( ) => {
78
79
const maxYear = getYear ( props . maxDate ? props . maxDate : new Date ( ) ) + 1
79
- return range ( 1979 , maxYear , 1 )
80
+ const minYear = getYear ( props . minYear ? props . minYear : 1979 )
81
+ return range ( minYear , maxYear , 1 )
80
82
} , [ props . maxDate ] )
81
83
82
84
const [ stateHasFocus , setStateHasFocus ] = useState ( false )
You can’t perform that action at this time.
0 commit comments