Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
chore: log2
Browse files Browse the repository at this point in the history
  • Loading branch information
behnaz-deriv committed Jun 11, 2024
1 parent 73599b1 commit 2a0e802
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,14 @@ const BirthPickerWrapper = styled.div<BirthPickerWrapperProps>`
const BirthPicker = ({ id, error, value, setFieldValue, label, label_color }: BirthPickerProps) => {
const [is_date_field, selectDateField] = useState(false)

console.log(is_date_field, 'is_date');
console.log(value, 'value');

const subtractYears = (numOfYears, date = new Date()) => {
date.setFullYear(date.getFullYear() - numOfYears)
return date
}
const max_date = subtractYears(18)

const handleDateChange = (date) => {
const handleDateChange = (date,e) => {
console.log(e.target)
console.log('==>', date)
setFieldValue((prev) => ({ ...prev, date_birth: date }))
}
Expand All @@ -126,7 +124,12 @@ const BirthPicker = ({ id, error, value, setFieldValue, label, label_color }: Bi
showLeadingZeros={false}
calendarIcon={<img src={Calendar} alt="calendar icon" />}
clearIcon={null}
onChange={handleDateChange}
onChange={(date) => {
console.log("selected date is:", date)
// const d = new Date(date).toLocaleDateString('fr-FR');
// console.log(d);
// setDate(d);
}}
/>
<AffiliateLabel htmlFor={id} label_color={label_color}>
{label}
Expand Down

0 comments on commit 2a0e802

Please sign in to comment.