Skip to content

Commit

Permalink
fix: do not call period generator with non-4-digit year (DHIS2-17707)
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardo committed Jul 12, 2024
1 parent 77f42a0 commit f7cfabf
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/components/PeriodDimension/PeriodTransfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,18 @@ const PeriodTransfer = ({

const onSelectFixedPeriods = (filter) => {
setFixedFilter(filter)
setAllPeriods(
getFixedPeriodsOptionsById(
filter.periodType,
periodsSettings
).getPeriods(
fixedPeriodConfig(Number(filter.year)),
periodsSettings

if (filter.year.match(/[0-9]{4}/)) {
setAllPeriods(
getFixedPeriodsOptionsById(
filter.periodType,
periodsSettings
).getPeriods(
fixedPeriodConfig(Number(filter.year)),
periodsSettings
)
)
)
}
}

const renderEmptySelection = () => (
Expand Down

0 comments on commit f7cfabf

Please sign in to comment.