From 09dc834c8916d15ce94019cf43af902c962d0f7a Mon Sep 17 00:00:00 2001 From: "MSI\\derek" Date: Tue, 24 Dec 2024 07:18:50 +0800 Subject: [PATCH] update project manhour search --- .../ProjectManhourSummaryReport.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/GenerateProjectManhourSummaryReport/ProjectManhourSummaryReport.tsx b/src/components/GenerateProjectManhourSummaryReport/ProjectManhourSummaryReport.tsx index 05f752f..7e0aeb4 100644 --- a/src/components/GenerateProjectManhourSummaryReport/ProjectManhourSummaryReport.tsx +++ b/src/components/GenerateProjectManhourSummaryReport/ProjectManhourSummaryReport.tsx @@ -7,6 +7,7 @@ import { useTranslation } from "react-i18next"; import { TeamResult } from "@/app/api/team"; import { fetchProjectManhourSummaryReport } from "@/app/api/reports/actions"; import { downloadFile } from "@/app/utils/commonUtil"; +import dayjs from "dayjs"; interface Props { teams: TeamResult[] @@ -48,17 +49,16 @@ const ProjectManhourSummaryReport: React.FC = ({ teams }) => { criteria={searchCriteria} onSearch={async (query: any) => { console.log(query); - var start = query.startDate - var start = query.startDate + var startDate = dayjs(query.startDate).format("YYYY-MM-DD") + var endDate = dayjs(query.endDate).add(1, "month").format("YYYY-MM-DD") const args = { teamId: query.teamId, - startDate: query.startDate + "-01", - endDate: query.endDate + "-01", + startDate: startDate, + endDate: endDate, } console.log(args) const response = await fetchProjectManhourSummaryReport(args);// if (response) { - console.log("asdasdas") downloadFile( new Uint8Array(response.blobValue), response.filename!!