当前位置:网站首页>[typescript] Use the RangePicker component in antd to implement time limit the previous year (365 days) of the current time
[typescript] Use the RangePicker component in antd to implement time limit the previous year (365 days) of the current time
2022-08-02 13:12:00 【Sco_Jing1031】
//先导入组件
import {
DatePicker } from 'antd';
import moment from 'moment';
const {
RangePicker } = DatePicker;
/**Operation time drop-down item */
const renderTimeSelect = () => {
/**The optional range is the most recent year */
const disabledDate = (m: Moment) =>
(m && m.isAfter(moment().endOf('day'))) ||
(m &&
m.isBefore(
moment()
.subtract(1, 'year')
.startOf('day'),
));
return (
<Form.Item label="操作时间">
{
getFieldDecorator('operationTime', {
initialValue: [
moment()
.subtract(30, 'days')
.startOf('day'),
moment(),
],
})(
<RangePicker
allowClear={
false}
showTime
format="YYYY-MM-DD HH:mm"
disabledDate={
disabledDate as any}
onOk={
() => {
LX(get(operationRecordLx, `operationTime.${
source}`));
}}
/>,
)}
</Form.Item>
);
};
边栏推荐
猜你喜欢
随机推荐
Seata分布式事务
移动端适配,华为浏览器底色无法正常显示
基于华为eNSP的企业网络规划
你知道图论的Dijkstra吗?
Markdown怎么加入emoji
Seata Distributed Transaction
SQL Server database generation and execution of SQL scripts
麻烦问一下,对mysql 场景注入故障,是不是不是对mysql server 端注入故障,只是对ja
冰箱“扩容”的战事,在今夏格外猛烈
.Net 5.0快速上手 Redis
鲁大师7月新机性能/流畅榜:骁龙8+正面对决天玑9000+,性能跑分突破123万!
网络流详解(流网图一般能够反映什么信息)
Singleton pattern of seven kinds of writing, you know?
This binding to detailed answers
FreeRTOS creation tasks - dynamic creation, static creation
ThinkPHP 5.1反序列化分析和poc
C语言结构体(入门)
Ribbon负载均衡的深度分析和使用
MFC入门教程(深入浅出MFC)
PHP+MYSQL [Student Information Management System] (Minimalist Edition)









