Skip to content

Commit

Permalink
EDSC-4125 pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-zamora committed Jan 28, 2025
1 parent 9101855 commit b3f3740
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,13 @@ export const GranuleFiltersForm = (props) => {
onSubmitStart={
(startDate, shouldSubmit) => {
const { temporal: newTemporal } = values

// If the recurring toggle is toggled on, the format of the date drops the year, when
// converted into a moment object, this will erroneously set the year to the current year.
// To avoid this, we check if the temporal is recurring and set the year to the existing year in
// state.
if (newTemporal.isRecurring) {
const existingStartDate = moment(values.temporal.startDate)
const existingStartDate = moment(newTemporal.startDate)
if (existingStartDate.isValid()) {
const existingStartDateYear = existingStartDate.year()
startDate.year(existingStartDateYear)
Expand Down

0 comments on commit b3f3740

Please sign in to comment.