mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
1 line
1.0 KiB
JavaScript
1 line
1.0 KiB
JavaScript
(("undefined"!=typeof globalThis?globalThis:self).makoChunk_antd=("undefined"!=typeof globalThis?globalThis:self).makoChunk_antd||[]).push([["e6aea9bd"],{e6aea9bd:function(e,a,r){"use strict";r.d(a,"__esModule",{value:!0}),r.d(a,"default",{enumerable:!0,get:function(){return y;}});var d=r("f19d2b93");r("f169af7a");var t=r("a9d1a279");let{RangePicker:n}=t.DatePicker,l=e=>12*e.year()+e.month(),s=(e,{from:a,type:r})=>{if(a){let d=a.add(-6,"days"),t=a.add(6,"days");switch(r){case"year":return e.year()<d.year()||e.year()>t.year();case"month":return l(e)<l(d)||l(e)>l(t);default:return Math.abs(e.diff(a,"days"))>=7;}}return!1;},i=(e,{from:a,type:r})=>{if(a){let d=a.add(-5,"months"),t=a.add(5,"months");return"year"===r?e.year()<d.year()||e.year()>t.year():l(e)<l(d)||l(e)>l(t);}return!1;};var y=()=>(0,d.jsxs)(t.Space,{direction:"vertical",children:[(0,d.jsx)(t.Typography.Title,{level:5,children:"7 days range"}),(0,d.jsx)(n,{disabledDate:s}),(0,d.jsx)(t.Typography.Title,{level:5,children:"6 months range"}),(0,d.jsx)(n,{disabledDate:i,picker:"month"})]});}}]); |