fix: sticky category column and month dropdown selector (#29) #30
1 changed files with 1 additions and 14 deletions
|
|
@ -224,19 +224,6 @@ export function useReports() {
|
|||
dispatch({ type: "SET_PERIOD", payload: period });
|
||||
}, []);
|
||||
|
||||
const navigateBudgetMonth = useCallback((delta: -1 | 1) => {
|
||||
let newMonth = state.budgetMonth + delta;
|
||||
let newYear = state.budgetYear;
|
||||
if (newMonth < 1) {
|
||||
newMonth = 12;
|
||||
newYear -= 1;
|
||||
} else if (newMonth > 12) {
|
||||
newMonth = 1;
|
||||
newYear += 1;
|
||||
}
|
||||
dispatch({ type: "SET_BUDGET_MONTH", payload: { year: newYear, month: newMonth } });
|
||||
}, [state.budgetYear, state.budgetMonth]);
|
||||
|
||||
const setBudgetMonth = useCallback((year: number, month: number) => {
|
||||
dispatch({ type: "SET_BUDGET_MONTH", payload: { year, month } });
|
||||
}, []);
|
||||
|
|
@ -253,5 +240,5 @@ export function useReports() {
|
|||
dispatch({ type: "SET_SOURCE_ID", payload: id });
|
||||
}, []);
|
||||
|
||||
return { state, setTab, setPeriod, setCustomDates, navigateBudgetMonth, setBudgetMonth, setPivotConfig, setSourceId };
|
||||
return { state, setTab, setPeriod, setCustomDates, setBudgetMonth, setPivotConfig, setSourceId };
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue