feat(Calendar): add max-range、range-prompt prop (#5583)

This commit is contained in:
KongYe
2020-01-15 16:34:13 +08:00
committed by neverland
parent cfd40f2eaf
commit 670b346963
11 changed files with 45 additions and 8 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
import { compareDay, compareMonth, getNextDay } from '../utils';
import { compareDay, compareMonth, getNextDay, calcDateNum } from '../utils';
const date1 = new Date(2010, 0, 1);
const date2 = new Date(2010, 0, 2);
@@ -24,3 +24,8 @@ test('getNextDay', () => {
expect(getNextDay(date1).getDate()).toEqual(2);
expect(getNextDay(date2).getDate()).toEqual(3);
});
test('calcDateNum', () => {
expect(calcDateNum([date1, date2])).toEqual(2);
expect(calcDateNum([date1, date3])).toEqual(32);
});