当前位置:网站首页>[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>
);
};
边栏推荐
- “二舅”火了,自媒体短视频“爆火”的基本要素,你知道吗?
- 图论之Floyd,多源图最短路如何暴力美学?
- PGSQL database to realize the import and export
- 移动端适配,华为浏览器底色无法正常显示
- Taurus.MVC V3.0.3 microservice open source framework released: Make the evolution of .NET architecture easier in large concurrency.
- 高效代码静态测试工具Klocwork 2022.2——Portal全新升级、支持RLM
- Js scratchable latex style draw plug-in
- 如何关闭开启硬件加速[通俗易懂]
- 图神经网络(GNN)的简介「建议收藏」
- 【C语言】剖析函数递归(1)
猜你喜欢
FreeRTOS--stack experiment
高效代码静态测试工具Klocwork 2022.2——Portal全新升级、支持RLM
FreeRTOS实验--一个函数创建多个任务
How to use the database like tap water?|Tencent Cloud Database TDSQL-C
你知道图论的spfa吗?
php - the first of three solid foundations
路由-Tab切换页面
图论之Floyd,多源图最短路如何暴力美学?
SQL Server 2019 installation error 0 x80004005 service there is no timely response to the start or control request a detailed solution
Closures in JS
随机推荐
How to implement waterfall flow layout (what is waterfall flow layout)
Automatically generate code generator recommendation-code-gen
嵌入式系统驱动初级【2】——字符设备驱动基础上_基础框架
【typescript】使用antd中RangePicker组件实现时间限制 当前时间的前一年(365天)
Introduction to Scala Basic Syntax (3) Various Operators in Scala
Markdown怎么加入emoji
js cool dashboard plugin
String concatenation in SQL
pytorch model to tensorflow model
图神经网络(GNN)的简介「建议收藏」
图文短视频自媒体怎么创作?如何让点击量达到10W?
FreeRTOS creation tasks - dynamic creation, static creation
吾爱第三课-修改版权和资源
微信小程序getPhoneNumber接口code=40013
js semi-circle loading progress animation js special effects
LeetCode_377_Combination Sum IV
FreeRTOS实验--一个函数创建多个任务
sql concat() function
RestTemplate 使用:设置请求头、请求体
【622. 设计循环队列】