Skip to content

Commit e71ecdd

Browse files
committed
MP-180 special year picker
1 parent 9c3b64e commit e71ecdd

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

src/apps/profiles/src/member-profile/education-and-certifications/ModifyEducationModal/ModifyEducationModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ const ModifyEducationModal: FC<ModifyEducationModalProps> = (props: ModifyEducat
258258
disabled={false}
259259
error={formErrors.endDate}
260260
dirty
261-
maxDate={new Date()}
261+
showMonthPicker={false}
262262
showYearPicker
263263
dateFormat='yyyy'
264264
/>

src/libs/ui/lib/components/form/form-groups/form-input/input-date-picker/InputDatePicker.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ interface InputDatePickerProps {
2727
readonly minDate?: Date | null | undefined;
2828
readonly minTime?: Date | undefined;
2929
readonly placeholder?: string
30+
readonly showMonthPicker?: boolean
3031
readonly showYearPicker?: boolean
3132
readonly tabIndex?: number
3233
}
@@ -63,16 +64,20 @@ const InputDatePicker: FC<InputDatePickerProps> = (props: InputDatePickerProps)
6364
<IconOutline.ArrowCircleLeftIcon />
6465
</button>
6566

66-
<select
67-
value={months[getMonth(date)]}
68-
onChange={({ target: { value } }: any) => changeMonth(months.indexOf(value))}
69-
>
70-
{months.map(option => (
71-
<option key={option} value={option}>
72-
{option}
73-
</option>
74-
))}
75-
</select>
67+
{
68+
props.showMonthPicker !== false && (
69+
<select
70+
value={months[getMonth(date)]}
71+
onChange={({ target: { value } }: any) => changeMonth(months.indexOf(value))}
72+
>
73+
{months.map(option => (
74+
<option key={option} value={option}>
75+
{option}
76+
</option>
77+
))}
78+
</select>
79+
)
80+
}
7681

7782
<select
7883
value={getYear(date)}

0 commit comments

Comments
 (0)