Skip to content

Commit

Permalink
Revert "fix(studio): Change default publication year"
Browse files Browse the repository at this point in the history
This reverts commit a298295.
  • Loading branch information
annelhote committed Dec 20, 2024
1 parent 7dd3977 commit 06050d4
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/components/Studio/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,25 @@ const Studio = () => {
: lastObservationSnap,
);
setObservationYearLast(lastObservationYearTmp);
setEndYear(lastObservationYearTmp - 1);
const observationYearsTmp = [
...Array(
// Number(lastObservationYearTmp) - Number(observationYearFirst) + 1,
2024 - Number(observationYearFirst) + 1,
).keys(),
].map((item) => ({
label: `${item + Number(observationYearFirst)}`,
value: `${item + Number(observationYearFirst)}`,
label: item + Number(observationYearFirst),
value: item + Number(observationYearFirst),
}));
observationYearsTmp.push({
label: "Date d'observation utilisée dans le baromètre national",
value: 'latest',
});
observationYearsTmp.push({ label: 'La plus récente', value: 'latest' });
setObservationYears(observationYearsTmp);
const publicationYearsTmp = [
// ...Array(Number(lastObservationYearTmp) - Number(startYear)).keys(),
...Array(2024 - Number(startYear)).keys(),
].map((item) => ({
label: `${item + Number(startYear)}`,
value: `${item + Number(startYear)}`,
label: item + Number(startYear),
value: item + Number(startYear),
}));

setEndYear(publicationYearsTmp[publicationYearsTmp.length - 1].value);
setPublicationYears(publicationYearsTmp);
}, [observationYearFirst, lastObservationSnap, startYear]);

Expand Down

0 comments on commit 06050d4

Please sign in to comment.