Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Calendar select can't switch #15338

Merged
merged 11 commits into from
Mar 12, 2019
6 changes: 3 additions & 3 deletions components/calendar/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ export default class Header extends React.Component<HeaderProps, any> {
const prefixCls = getPrefixCls('fullcalendar', customizePrefixCls);
const yearSelect = this.getYearSelectElement(prefixCls, value.year());
const monthSelect =
type === 'date'
type === 'month'
? this.getMonthSelectElement(prefixCls, value.month(), this.getMonthsLocale(value))
: null;
const size = (fullscreen ? 'default' : 'small') as any;
const typeSwitch = (
<Group onChange={this.onTypeChange} value={type} size={size}>
<Button value="date">{locale.month}</Button>
<Button value="month">{locale.year}</Button>
<Button value="month">{locale.month}</Button>
<Button value="year">{locale.year}</Button>
</Group>
);

Expand Down
16 changes: 8 additions & 8 deletions components/calendar/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
checked=""
class="ant-radio-button-input"
type="radio"
value="date"
value="month"
/>
<span
class="ant-radio-button-inner"
Expand All @@ -139,7 +139,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
<input
class="ant-radio-button-input"
type="radio"
value="month"
value="year"
/>
<span
class="ant-radio-button-inner"
Expand Down Expand Up @@ -1165,7 +1165,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
checked=""
class="ant-radio-button-input"
type="radio"
value="date"
value="month"
/>
<span
class="ant-radio-button-inner"
Expand All @@ -1184,7 +1184,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
<input
class="ant-radio-button-input"
type="radio"
value="month"
value="year"
/>
<span
class="ant-radio-button-inner"
Expand Down Expand Up @@ -2208,7 +2208,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
checked=""
class="ant-radio-button-input"
type="radio"
value="date"
value="month"
/>
<span
class="ant-radio-button-inner"
Expand All @@ -2227,7 +2227,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
<input
class="ant-radio-button-input"
type="radio"
value="month"
value="year"
/>
<span
class="ant-radio-button-inner"
Expand Down Expand Up @@ -3661,7 +3661,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
checked=""
class="ant-radio-button-input"
type="radio"
value="date"
value="month"
/>
<span
class="ant-radio-button-inner"
Expand All @@ -3680,7 +3680,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
<input
class="ant-radio-button-input"
type="radio"
value="month"
value="year"
/>
<span
class="ant-radio-button-inner"
Expand Down
Loading