세금 계산서 및 달력 월 형태 수정
This commit is contained in:
@@ -25,10 +25,10 @@ const NiceCalendarMonth = ({
|
||||
calendarType,
|
||||
setNewMonth
|
||||
}: NiceCalendarProps) => {
|
||||
const [valueMonth, setValueMonth] = useState<string>();
|
||||
const [valueYear, setValueYear] = useState<string>();
|
||||
const [minMonth, setMinMonth] = useState<Date | undefined>();
|
||||
const [maxMonth, setMaxMonth] = useState<Date | undefined>();
|
||||
const onchangeToMonth = (selectedMonth: any) => {
|
||||
const onChangeToMonth = (selectedMonth: any) => {
|
||||
setNewMonth(moment(selectedMonth).format('YYYY.MM'));
|
||||
setCalendarOpen(false);
|
||||
};
|
||||
@@ -42,17 +42,17 @@ const NiceCalendarMonth = ({
|
||||
if(!!endMonth){
|
||||
setMaxMonth(new Date(endMonth));
|
||||
}
|
||||
setValueMonth(startMonth);
|
||||
setValueYear(startMonth?.substring(0, 4));
|
||||
}
|
||||
else if(calendarType === CalendarType.End){
|
||||
if(!!startMonth){
|
||||
setMinMonth(new Date(startMonth));
|
||||
}
|
||||
setMaxMonth(new Date());
|
||||
setValueMonth(endMonth);
|
||||
setValueYear(endMonth?.substring(0, 4));
|
||||
}
|
||||
else if(calendarType === CalendarType.Single){
|
||||
setValueMonth(singleMonth);
|
||||
setValueYear(singleMonth?.substring(0,4));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -97,8 +97,8 @@ const NiceCalendarMonth = ({
|
||||
<Calendar
|
||||
minDate={ minMonth }
|
||||
maxDate={ maxMonth }
|
||||
onClickMonth={ onchangeToMonth }
|
||||
value={ valueMonth }
|
||||
onClickMonth={ onChangeToMonth }
|
||||
value={ valueYear }
|
||||
formatMonthYear={ formatMonthYear }
|
||||
formatYear= { formatYear }
|
||||
formatMonth={ formmatMonth }
|
||||
|
||||
@@ -66,10 +66,10 @@ export const FilterCalendarMonth = ({
|
||||
const setNewMonth = (month: string) => {
|
||||
console.log(month)
|
||||
if(calendarType === CalendarType.Start){
|
||||
setStartMonth(month);
|
||||
setStartMonth(moment(month+'.01').format('YYYYMM'));
|
||||
}
|
||||
else if(calendarType === CalendarType.End){
|
||||
setEndMonth(month);
|
||||
setEndMonth(moment(month+'.01').format('YYYYMM'));
|
||||
}
|
||||
setCalendarOpen(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user