mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-05-28 17:14:07 +03:00
fix: shortcus with range (#400)
This commit is contained in:
@@ -212,6 +212,19 @@ describe('DatePicker', () => {
|
||||
btn.trigger('click');
|
||||
const emitted = wrapper.emitted();
|
||||
expect(emitted.input).toEqual([['2019/05/10']]);
|
||||
wrapper.setProps({
|
||||
range: true,
|
||||
shortcuts: [
|
||||
{
|
||||
text: 'range',
|
||||
onClick() {
|
||||
return [date, date];
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
btn.trigger('click');
|
||||
expect(emitted.input[1]).toEqual([['2019/05/10', '2019/05/10']]);
|
||||
});
|
||||
|
||||
it('prop: popupClass', () => {
|
||||
|
||||
+1
-1
@@ -379,7 +379,7 @@ export default {
|
||||
handleSelectShortcut(item) {
|
||||
if (isObject(item) && typeof item.onClick === 'function') {
|
||||
const date = item.onClick(this);
|
||||
if (date instanceof Date) {
|
||||
if (date) {
|
||||
this.emitValue(date);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user