当前位置:网站首页>[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>
);
};
边栏推荐
- js stopwatch countdown plugin
- Interpretation of new features | MySQL 8.0 GIPK invisible primary key
- svg实现的树木四季变化
- Cannot determine loading status from target frame detached when selenium chrome driver is running
- 自媒体创作怎样提高原创度,打造爆款作品?
- 设置代理服务器(谷歌+IE)「建议收藏」
- js半圆环加载进度动画js特效
- Do you know Dijkstra of graph theory?
- 自动生成代码器推荐-code-gen
- js semi-circle loading progress animation js special effects
猜你喜欢
js九宫格样式抽奖插件
FreeRTOS experiment -- delete task
Get out of the machine learning world forever!
WPF效果第一百九十三篇之登录实现
短视频美食自媒体怎么做?5步教你快速上手
图论之Kruskal,最小生成树如何优雅解题?
SQL Server database generation and execution of SQL scripts
“二舅”火了,自媒体短视频“爆火”的基本要素,你知道吗?
RESTful 风格(详细介绍 + 案例实现)
To eliminate air bubbles to save the mushroom h5 small game source code
随机推荐
无线振弦采集仪远程修改参数方式
Cannot determine loading status from target frame detached when selenium chrome driver is running
永远退出机器学习界!
UAC绕过学习-总结
Wireless vibrating wire acquisition instrument remote modification method
【C语言】函数哪些事儿,你真的get到了吗?(2)
汉源高科千兆12光12电管理型工业以太网交换机 12千兆光12千兆电口宽温环网交换机
Get out of the machine learning world forever!
How to use the database like tap water?|Tencent Cloud Database TDSQL-C
【C语言】函数哪些事儿,你真的get到了吗?(1)
我的创作纪念日
读《IDEO,设计改变一切》有感
FreeRTOS中名称规范
单例模式的七种写法,你都知道吗?
There are several ways to jump to js source code, jump on the current page, jump on the blank page
RestTemplate use: set request header, request body
js semi-circle loading progress animation js special effects
this的绑定指向详细解答
自动生成代码器推荐-code-gen
图论之Floyd,多源图最短路如何暴力美学?