日期范围选择组件
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user