Skip to content

Commit

Permalink
[Vote] use dynamic year (#3174)
Browse files Browse the repository at this point in the history
  • Loading branch information
ottaviano authored Jan 7, 2025
1 parent e738406 commit cfad51f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Consultations/Edit/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const useFormContextCreateDesignation = () => useFormContext<DesignationT
export const useTargetYearChoices = () =>
useMemo(
() =>
Array.from({ length: 3 }, (_, i) => new Date().getFullYear() - i).map(year => ({
Array.from({ length: new Date().getFullYear() - 2022 + 1 }, (_, i) => new Date().getFullYear() - i).map(year => ({
value: year,
label: `À partir des adhérents à jour ${year}`,
})),
Expand Down
2 changes: 1 addition & 1 deletion src/domain/designation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class Designation {
}

fillDefaultVoteState() {
this.targetYear = 2023
this.targetYear = new Date().getFullYear() - 1
this.questions.push(
...[
new Question('Approbation de la modification des statuts', [
Expand Down

0 comments on commit cfad51f

Please sign in to comment.