Refactor_Expenses #321

Merged
pramod.mahajan merged 249 commits from Refactor_Expenses into hotfix/MasterActivity 2025-08-01 13:14:59 +00:00
2 changed files with 20 additions and 12 deletions
Showing only changes of commit 0a1d2e8459 - Show all commits

View File

@ -106,6 +106,6 @@ export const defaultFilter = {
statusIds:[], statusIds:[],
createdByIds:[], createdByIds:[],
paidById:[], paidById:[],
startDate:"", startDate:null,
endDate:"" endDate:null
} }

View File

@ -148,16 +148,24 @@ const ExpensePage = () => {
const onSubmit = (data) => { const onSubmit = (data) => {
setFilter(data) setFilter(data)
}; };
const setDateRange = ({ startDate, endDate }) => { const isValidDate = (date) => {
setValue( return date instanceof Date && !isNaN(date);
"startDate", };
startDate ? new Date(startDate).toISOString().split("T")[0] : null
); const setDateRange = ({ startDate, endDate }) => {
setValue( const parsedStart = new Date(startDate);
"endDate", const parsedEnd = new Date(endDate);
endDate ? new Date(endDate).toISOString().split("T")[0] : null
); setValue(
}; "startDate",
isValidDate(parsedStart) ? parsedStart.toISOString().split("T")[0] : null
);
setValue(
"endDate",
isValidDate(parsedEnd) ? parsedEnd.toISOString().split("T")[0] : null
);
};
const toggleDropdown = () => { const toggleDropdown = () => {
setIsOpen((prev) => { setIsOpen((prev) => {