fo: default 년도 설정
This commit is contained in:
@@ -162,11 +162,11 @@ const selectFacilityPartData: SelectDataType[] = [
|
||||
const getYearData = () => {
|
||||
const today = new Date();
|
||||
const year = today.getFullYear();
|
||||
// const month = today.getMonth() + 1;
|
||||
|
||||
const month = today.getMonth() + 1;
|
||||
|
||||
// 상반기(6월까지)는 2년 전, 하반기는 1년 전부터 시작
|
||||
// const startYear = month <= 6 ? (year - 2) : (year - 1);
|
||||
const startYear = year - 1;
|
||||
const defaultIdx = month <= 6 ? 2 : 1;
|
||||
const startYear = year;
|
||||
|
||||
// 최근 10개년도 제공 (기본값: 첫 번째 항목 선택)
|
||||
return Array.from({ length: 10 }, (_, index) => {
|
||||
@@ -174,7 +174,7 @@ const getYearData = () => {
|
||||
return {
|
||||
text: `${targetYear}년`,
|
||||
val: targetYear.toString(),
|
||||
selected: index === 0,
|
||||
selected: index === defaultIdx,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user