From e85dfb392282ae8d85f0f3134245b8e26eba78cc Mon Sep 17 00:00:00 2001 From: Kartik sharma Date: Tue, 1 Jul 2025 16:47:03 +0530 Subject: [PATCH 01/12] In Attendance Log Tab date Range show set to today -1 to past 7 days. --- src/components/common/DateRangePicker.jsx | 33 ++++++++++++----------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/components/common/DateRangePicker.jsx b/src/components/common/DateRangePicker.jsx index 0760cb50..a417a413 100644 --- a/src/components/common/DateRangePicker.jsx +++ b/src/components/common/DateRangePicker.jsx @@ -2,37 +2,40 @@ import React, { useEffect, useRef } from "react"; const DateRangePicker = ({ onRangeChange, - DateDifference = 7, - endDateMode = "yesterday", // "today" or "yesterday" + DateDifference = 7, + endDateMode = "yesterday", }) => { const inputRef = useRef(null); useEffect(() => { const endDate = new Date(); if (endDateMode === "yesterday") { - endDate.setDate(endDate.getDate() - 1); + endDate.setDate(endDate.getDate() - 1); } - const startDate = new Date(); - startDate.setDate(endDate.getDate() - DateDifference); + endDate.setHours(0, 0, 0, 0); + + const startDate = new Date(endDate); + startDate.setDate(endDate.getDate() - (DateDifference - 1)); + startDate.setHours(0, 0, 0, 0); const fp = flatpickr(inputRef.current, { mode: "range", - dateFormat: "Y-m-d", - altInput: true, - altFormat: "d-m-Y", - defaultDate: [startDate, endDate], - static: true, - clickOpens: true, + dateFormat: "Y-m-d", + altInput: true, + altFormat: "d-m-Y", + defaultDate: [startDate, endDate], + static: true, + clickOpens: true, onChange: (selectedDates, dateStr) => { - const [startDate, endDate] = dateStr.split(" to "); - onRangeChange?.({ startDate, endDate }); + const [startDateString, endDateString] = dateStr.split(" to "); + onRangeChange?.({ startDate: startDateString, endDate: endDateString }); }, }); onRangeChange?.({ - startDate: startDate.toLocaleDateString("en-CA"), - endDate: endDate.toLocaleDateString("en-CA"), + startDate: startDate.toLocaleDateString("en-CA"), + endDate: endDate.toLocaleDateString("en-CA"), }); return () => { From b74c863794a301a1cfbbc52144e08c23c79bf633 Mon Sep 17 00:00:00 2001 From: Kartik sharma Date: Tue, 1 Jul 2025 17:14:03 +0530 Subject: [PATCH 02/12] Reduce the checkbox size and remove unnecessary spacing within the Directory Notes and Contact filters. --- src/pages/Directory/DirectoryPageHeader.jsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/pages/Directory/DirectoryPageHeader.jsx b/src/pages/Directory/DirectoryPageHeader.jsx index 6a3ae418..72f6390b 100644 --- a/src/pages/Directory/DirectoryPageHeader.jsx +++ b/src/pages/Directory/DirectoryPageHeader.jsx @@ -306,7 +306,7 @@ const DirectoryPageHeader = ({ )} -
+
{/* Scrollable Filter Content */}
{/* Created By */} -
+

Created By

{allCreators.map((name, idx) => (
handleToggleCreator(name)} + style={{ width: "1rem", height: "1rem" }} />
{/* Organization */} -
+

Organization

{filteredOrganizations.map((org, idx) => (
handleToggleOrg(org)} + style={{ width: "1rem", height: "1rem" }} />