Bläddra i källkod

Update date range picker formatting in StatsDashboardPage for dynamic report types

- Enhanced the RangePicker component to support different date formats based on the selected report type (daily, weekly, monthly).
- Improved user experience by allowing clearer date selection aligned with the report context.
0es 3 veckor sedan
förälder
incheckning
b3799d826d
1 ändrade filer med 10 tillägg och 1 borttagningar
  1. 10 1
      src/app/(dashboard)/statistics/dashboard/page.tsx

+ 10 - 1
src/app/(dashboard)/statistics/dashboard/page.tsx

@@ -679,9 +679,18 @@ const StatsDashboardPage: React.FC = () => {
           />
           <RangePicker
             allowClear
+            picker={
+              reportType === 0 ? "date" : reportType === 1 ? "week" : "month"
+            }
             value={effectiveRange}
             onChange={handleRangeChange as never}
-            format="YYYY-MM-DD"
+            format={
+              reportType === 0
+                ? "YYYY-MM-DD"
+                : reportType === 1
+                  ? "GGGG-[W]WW"
+                  : "YYYY-MM"
+            }
           />
         </Space>
       </div>