@@ -43,30 +43,57 @@ it('range isOverlap', () => {
4343 const otherDate2 = '2021-07-19 00:00:00' ;
4444
4545 expect (
46- dayjsRange ( startDate , endDate ) . isOverlap ( dayjsRange ( startDate , endDate ) ) ,
46+ dayjsRange ( startDate , otherDate ) . isOverlap ( dayjsRange ( endDate , otherDate2 ) ) ,
4747 ) . toBe ( true ) ;
4848 expect (
49- dayjsRange ( endDate , startDate ) . isOverlap ( dayjsRange ( startDate , endDate ) ) ,
49+ dayjsRange ( endDate , otherDate2 ) . isOverlap ( dayjsRange ( startDate , otherDate ) ) ,
5050 ) . toBe ( true ) ;
5151 expect (
52- dayjsRange ( startDate , endDate ) . isOverlap ( dayjsRange ( endDate , otherDate ) ) ,
52+ dayjsRange ( startDate , endDate ) . isOverlap ( dayjsRange ( startDate , otherDate ) ) ,
5353 ) . toBe ( true ) ;
5454 expect (
55- dayjsRange ( startDate , endDate ) . isOverlap ( dayjsRange ( otherDate , otherDate2 ) ) ,
56- ) . toBe ( false ) ;
57- expect (
58- dayjsRange ( startDate , otherDate ) . isOverlap ( dayjsRange ( endDate , otherDate2 ) ) ,
55+ dayjsRange ( startDate , otherDate ) . isOverlap ( dayjsRange ( startDate , endDate ) ) ,
5956 ) . toBe ( true ) ;
6057 expect (
6158 dayjsRange ( startDate , otherDate2 ) . isOverlap ( dayjsRange ( endDate , otherDate ) ) ,
6259 ) . toBe ( true ) ;
6360 expect (
6461 dayjsRange ( endDate , otherDate ) . isOverlap ( dayjsRange ( startDate , otherDate2 ) ) ,
6562 ) . toBe ( true ) ;
63+ expect (
64+ dayjsRange ( startDate , endDate ) . isOverlap ( dayjsRange ( startDate , endDate ) ) ,
65+ ) . toBe ( true ) ;
66+ expect (
67+ dayjsRange ( startDate , endDate ) . isOverlap ( dayjsRange ( otherDate , otherDate2 ) ) ,
68+ ) . toBe ( false ) ;
69+ expect (
70+ dayjsRange ( otherDate , otherDate2 ) . isOverlap ( dayjsRange ( startDate , endDate ) ) ,
71+ ) . toBe ( false ) ;
72+ expect (
73+ dayjsRange ( startDate , endDate ) . isOverlap ( dayjsRange ( endDate , otherDate ) ) ,
74+ ) . toBe ( false ) ;
75+ expect (
76+ dayjsRange ( endDate , otherDate ) . isOverlap ( dayjsRange ( startDate , endDate ) ) ,
77+ ) . toBe ( false ) ;
78+ expect (
79+ dayjsRange ( startDate , startDate ) . isOverlap ( dayjsRange ( startDate , endDate ) ) ,
80+ ) . toBe ( false ) ;
81+ expect (
82+ dayjsRange ( startDate , endDate ) . isOverlap ( dayjsRange ( startDate , startDate ) ) ,
83+ ) . toBe ( false ) ;
84+ expect (
85+ dayjsRange ( endDate , endDate ) . isOverlap ( dayjsRange ( startDate , endDate ) ) ,
86+ ) . toBe ( false ) ;
87+ expect (
88+ dayjsRange ( startDate , endDate ) . isOverlap ( dayjsRange ( endDate , endDate ) ) ,
89+ ) . toBe ( false ) ;
6690 expect ( dayjsRange ( endDate , otherDate ) . isOverlap ( ) ) . toBe ( false ) ;
6791 expect (
6892 dayjsRange ( startDate , endDate ) . isOverlap ( dayjsRange ( startDate , null ) ) ,
6993 ) . toBe ( false ) ;
94+ expect (
95+ dayjsRange ( startDate , endDate ) . isOverlap ( dayjsRange ( endDate , endDate ) ) ,
96+ ) . toBe ( false ) ;
7097} ) ;
7198
7299it ( 'range get date' , ( ) => {
0 commit comments