Skip to content

Commit

Permalink
Remove duplicate declaration of defaultprops in calendar component (H…
Browse files Browse the repository at this point in the history
…acker0x01#1566)

* Removed duplicate declaration of defaultprops in calendar component

* double quotes back to single quotes
  • Loading branch information
gautam-pahuja authored and martijnrusschen committed Dec 1, 2018
1 parent f1b2969 commit 20bd487
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions src/calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,6 @@ export default class Calendar extends React.Component {
};
}

static get defaultProps() {
return {
onDropdownFocus: () => {},
monthsShown: 1,
forceShowMonthNavigation: false,
timeCaption: 'Time'
};
}

constructor(props) {
super(props);

Expand Down Expand Up @@ -286,7 +277,7 @@ export default class Calendar extends React.Component {
const dayNames = [];
if (this.props.showWeekNumbers) {
dayNames.push(
<div key="W" className="react-datepicker__day-name">
<div key='W' className='react-datepicker__day-name'>
{this.props.weekLabel || '#'}
</div>
);
Expand All @@ -296,7 +287,7 @@ export default class Calendar extends React.Component {
const day = addDays(startOfWeek, offset);
const weekDayName = this.formatWeekday(day, this.props.locale);
return (
<div key={offset} className="react-datepicker__day-name">
<div key={offset} className='react-datepicker__day-name'>
{weekDayName}
</div>
);
Expand Down Expand Up @@ -346,7 +337,7 @@ export default class Calendar extends React.Component {

return (
<button
type="button"
type='button'
className={classes.join(' ')}
onClick={clickHandler}
>
Expand Down Expand Up @@ -391,7 +382,7 @@ export default class Calendar extends React.Component {

return (
<button
type="button"
type='button'
className={classes.join(' ')}
onClick={clickHandler}
>
Expand Down Expand Up @@ -479,7 +470,7 @@ export default class Calendar extends React.Component {
}
return (
<div
className="react-datepicker__today-button"
className='react-datepicker__today-button'
onClick={e => this.props.onSelect(getStartOfToday(), e)}
>
{this.props.todayButton}
Expand All @@ -488,19 +479,19 @@ export default class Calendar extends React.Component {
};

renderDefaultHeader = ({ monthDate, i }) => (
<div className="react-datepicker__header">
<div className='react-datepicker__header'>
{this.renderCurrentMonth(monthDate)}
<div
className={`react-datepicker__header__dropdown react-datepicker__header__dropdown--${
this.props.dropdownMode
}`}
}`}
onFocus={this.handleDropdownFocus}
>
{this.renderMonthDropdown(i !== 0)}
{this.renderMonthYearDropdown(i !== 0)}
{this.renderYearDropdown(i !== 0)}
</div>
<div className="react-datepicker__day-names">
<div className='react-datepicker__day-names'>
{this.header(monthDate)}
</div>
</div>
Expand All @@ -523,7 +514,7 @@ export default class Calendar extends React.Component {

return (
<div
className="react-datepicker__header react-datepicker__header--custom"
className='react-datepicker__header react-datepicker__header--custom'
onFocus={this.props.onDropdownFocus}
>
{this.props.renderCustomHeader({
Expand All @@ -535,7 +526,7 @@ export default class Calendar extends React.Component {
prevMonthButtonDisabled,
nextMonthButtonDisabled
})}
<div className="react-datepicker__day-names">
<div className='react-datepicker__day-names'>
{this.header(monthDate)}
</div>
</div>
Expand All @@ -557,7 +548,7 @@ export default class Calendar extends React.Component {
ref={div => {
this.monthContainer = div;
}}
className="react-datepicker__month-container"
className='react-datepicker__month-container'
>
{this.props.renderCustomHeader
? this.renderCustomHeader({ monthDate, i })
Expand Down

0 comments on commit 20bd487

Please sign in to comment.