feat(Calendar): auto selected to max range (#5992)

This commit is contained in:
neverland
2020-04-03 15:22:02 +08:00
committed by GitHub
parent 3f8928b02d
commit 64e77f3d2a
7 changed files with 82 additions and 41 deletions
+8 -20
View File
@@ -1,26 +1,14 @@
import Calendar from '..';
import { mount, later } from '../../../test';
import { getNextDay } from '../utils';
const now = new Date();
const minDate = new Date(2010, 0, 10);
const maxDate = new Date(2010, 0, 20);
function formatDate(date) {
if (date) {
return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`;
}
return '';
}
function formatRange([start, end]) {
return `${formatDate(start)}-${formatDate(end)}`;
}
function formatMultiple(dates) {
return dates.map(formatDate).join(',');
}
import {
now,
minDate,
maxDate,
formatDate,
formatRange,
formatMultiple,
} from './utils';
test('select event when type is single', async () => {
const wrapper = mount(Calendar, {