mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +08:00
fix: datepicker style error
This commit is contained in:
parent
f7a7d55e6b
commit
655ae8e4b4
@ -177,4 +177,16 @@ describe('DatePicker', () => {
|
||||
wrapper.find('.ant-calendar-prev-month-btn').simulate('click');
|
||||
expect(wrapper.find('.ant-calendar-my-select').text()).toBe('Jun2017');
|
||||
});
|
||||
|
||||
it('disabled date', () => {
|
||||
function disabledDate(current) {
|
||||
return current && current < moment().endOf('day');
|
||||
}
|
||||
|
||||
const wrapper = mount(
|
||||
<DatePicker disabledDate={disabledDate} />
|
||||
);
|
||||
|
||||
expect(wrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
@ -1,5 +1,37 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`DatePicker disabled date 1`] = `
|
||||
<span
|
||||
class="ant-calendar-picker"
|
||||
>
|
||||
<div>
|
||||
<input
|
||||
class="ant-calendar-picker-input ant-input"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
value=""
|
||||
/>
|
||||
<i
|
||||
class="anticon anticon-calendar ant-calendar-picker-icon"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class=""
|
||||
data-icon="calendar"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"
|
||||
/>
|
||||
</svg>
|
||||
</i>
|
||||
</div>
|
||||
</span>
|
||||
`;
|
||||
|
||||
exports[`DatePicker prop locale should works 1`] = `
|
||||
<span
|
||||
class="ant-calendar-picker"
|
||||
|
@ -240,7 +240,7 @@
|
||||
}
|
||||
&-disabled-cell&-today &-date {
|
||||
position: relative;
|
||||
margin-right: 5px;
|
||||
padding-right: 5px;
|
||||
padding-left: 5px;
|
||||
&:before {
|
||||
content: " ";
|
||||
|
Loading…
Reference in New Issue
Block a user