Skip to content

PM-1384 Fix date picker in copilot form#1144

Merged
kkartunov merged 2 commits intodevfrom
PM-1384
Jul 23, 2025
Merged

PM-1384 Fix date picker in copilot form#1144
kkartunov merged 2 commits intodevfrom
PM-1384

Conversation

@himaniraghav3
Copy link
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-1384

What's in this PR?

Removes the previous years and shows only current and next two years in the year dropdown of date picker

return range(1979, maxYear, 1)
const minYear = getYear(props.minYear ? props.minYear : 1979)
return range(minYear, maxYear, 1)
}, [props.maxDate])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency array for useMemo should include props.minYear as it is used to calculate minYear. This ensures that the memoized value updates correctly when props.minYear changes.

Copy link
Collaborator

@kkartunov kkartunov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@kkartunov kkartunov merged commit 8bb8aba into dev Jul 23, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants