[offers][fix] Fix year options (#548)
parent
ff54652f54
commit
1db5e46fcf
@ -1,8 +1,12 @@
|
|||||||
const NUM_YEARS = 5;
|
const NUM_YEARS = 5;
|
||||||
export const FutureYearsOptions = Array.from({ length: NUM_YEARS }, (_, i) => {
|
const OFFSET = 2;
|
||||||
const year = new Date().getFullYear() + i;
|
export const YearsOptions = (yearSelected?: number) =>
|
||||||
return {
|
Array.from({ length: NUM_YEARS }, (_, i) => {
|
||||||
label: String(year),
|
const year = yearSelected
|
||||||
value: year,
|
? yearSelected - OFFSET + i
|
||||||
};
|
: new Date().getFullYear() - OFFSET + i;
|
||||||
});
|
return {
|
||||||
|
label: String(year),
|
||||||
|
value: year,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
Loading…
Reference in new issue