react-persian-dates
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "react-persian-dates", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Persian Datepicker for React, NO \"moment.js\" NEEDED!", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -8,22 +8,5 @@ import React, {Component} from 'react'; | ||
export default class Datepicker extends Component { | ||
static defaultProps = { | ||
selectFrom: new Date(), | ||
startDate: new Date(), | ||
type: 'persian', | ||
monthsCount: 5, | ||
} | ||
static propTypes = { | ||
onSelect: PropTypes.func | ||
} | ||
constructor(props) { | ||
super(props); | ||
let {selectFrom, selectTo, startDate, rangeSelect, type, monthsCount} = props; | ||
if (rangeSelect) { | ||
this.selectFrom = selectFrom; | ||
this.selectTo = selectTo !== selectFrom ? selectTo : null; | ||
} else { | ||
this.selectFrom = this.selectTo = selectFrom; | ||
} | ||
const to = (rangeSelect && (selectTo !== selectFrom)) ? selectTo : selectFrom; | ||
@@ -95,3 +78,3 @@ this.state = { | ||
}); | ||
} | ||
}; | ||
@@ -104,3 +87,3 @@ renderWeekdays = () => { | ||
); | ||
} | ||
}; | ||
@@ -120,1 +103,12 @@ render() { | ||
} | ||
Datepicker.defaultProps = { | ||
selectFrom: new Date(), | ||
startDate: new Date(), | ||
type: 'persian', | ||
monthsCount: 5, | ||
}; | ||
Datepicker.propTypes = { | ||
onSelect: PropTypes.func | ||
}; |
@@ -6,11 +6,2 @@ import React, {Component} from 'react'; | ||
class Day extends Component { | ||
static defaultProps = {}; | ||
static propTypes = { | ||
disabled: PropTypes.bool, | ||
status: PropTypes.string, | ||
persianDate: PropTypes.array, | ||
onSelect: PropTypes.func, | ||
}; | ||
render() { | ||
@@ -53,2 +44,9 @@ const {disabled, status, date, persianDate, onSelect} = this.props; | ||
Day.propTypes = { | ||
disabled: PropTypes.bool, | ||
status: PropTypes.string, | ||
persianDate: PropTypes.array, | ||
onSelect: PropTypes.func, | ||
}; | ||
export default Day; |
@@ -6,9 +6,2 @@ import React, {PureComponent} from 'react'; | ||
class Month extends PureComponent { | ||
static propTypes = { | ||
month: PropTypes.array, | ||
monthTitle: PropTypes.string, | ||
onSelect: PropTypes.func, | ||
}; | ||
render() { | ||
@@ -38,2 +31,8 @@ const { month, monthTitle, onSelect } = this.props; | ||
Month.propTypes = { | ||
month: PropTypes.array, | ||
monthTitle: PropTypes.string, | ||
onSelect: PropTypes.func, | ||
}; | ||
export default Month; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34603
464