日期范围选择组件

This commit is contained in:
2025-09-25 00:10:24 +08:00
parent dd1136d1e6
commit d99d3d87a9
4 changed files with 374 additions and 258 deletions

View File

@@ -1,6 +1,7 @@
import React, { useState, useEffect } from "react";
import { View, Text, Button } from "@tarojs/components";
import Taro, { useDidShow } from "@tarojs/taro";
import dayjs from 'dayjs'
import "./index.scss";
import { DialogCalendarCard } from "@/components/index";
@@ -56,8 +57,13 @@ const DownloadBill: React.FC = () => {
}
};
const [currentTimeValue, setCurrentTimeValue] = useState<Date | Date[]>(new Date());
const handleConfirm = (val) => {
const handleConfirm = (val: Date[]) => {
setCurrentTimeValue(val);
const [start, end] = val;
setDateRange({
start: dayjs(start).format("YYYY-MM-DD"),
end: dayjs(end).format("YYYY-MM-DD"),
});
};
return (
<View className="download_bill_page">