Skip to content

Commit

Permalink
v0.12.3 - fixed max date range issue (plotly#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
alishobeiri committed Aug 18, 2017
1 parent 58acdbd commit 3d00e17
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
4 changes: 4 additions & 0 deletions packages/dash-core-components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.12.3] - 2017-08-17
### Fixed
- Previously, the `max_date_allowed` could not be selected. This issue has been fixed, issue first reported in https://community.plot.ly/t/solved-datepicker-in-dash/4816/10

## [0.12.2] - 2017-08-10
### Fixed
- Previously, when the `options` of a `dcc.Dropdown` would change, the options would no longer be searchable. That has been fixed. Issue was originally reported in https://community.plot.ly/t/dropdown-not-searching-values-when-typing/5323/3
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.12.2'
__version__ = '0.12.3'
3 changes: 2 additions & 1 deletion packages/dash-core-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-core-components",
"version": "0.12.2",
"version": "0.12.3",
"description": "Core component suite for Dash",
"repository": {
"type": "git",
Expand Down Expand Up @@ -32,6 +32,7 @@
"ramda": "^0.23.0",
"rc-slider": "^6.1.0",
"react": "^15.4.0",
"react-addons-shallow-compare": "^15.6.0",
"react-dates": "^12.3.0",
"react-dom": "^15.4.0",
"react-markdown": "^2.4.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default class DatePickerRange extends Component {

if (typeof props.maxDateAllowed !== 'undefined') {
max = moment(props.maxDateAllowed);
max.add(1, 'days');
}

try {
Expand Down Expand Up @@ -177,7 +178,8 @@ export default class DatePickerRange extends Component {
isOutsideRange={(date) => {
if (typeof this.state.minDateAllowed !== 'undefined' &&
typeof this.state.maxDateAllowed !== 'undefined') {
return date < this.state.minDateAllowed || date >= this.state.maxDateAllowed;
return date < this.state.minDateAllowed ||
date >= this.state.maxDateAllowed;
} else if (typeof this.state.minDateAllowed === 'undefined' &&
typeof this.state.maxDateAllowed !== 'undefined') {
return date >= this.state.maxDateAllowed;
Expand Down Expand Up @@ -357,9 +359,11 @@ DatePickerRange.propTypes = {
*/
disabled: PropTypes.bool,

/**
* If True, there will be a button that allows for clearing the dates
*/
/**
* Whether or not the dropdown is "clearable", that is, whether or
* not a small "x" appears on the right of the dropdown that removes
* the selected value.
*/
clearable: PropTypes.bool,

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default class DatePickerSingle extends Component {

if (typeof props.maxDateAllowed !== 'undefined') {
max = moment(props.maxDateAllowed);
max.add(1, 'days');
}

return { date, initialVisibleMonth, min, max };
Expand Down Expand Up @@ -282,9 +283,11 @@ DatePickerSingle.propTypes = {
*/
disabled: PropTypes.bool,

/**
* If True, there will be a button that allows for clearing the dates
*/
/**
* Whether or not the dropdown is "clearable", that is, whether or
* not a small "x" appears on the right of the dropdown that removes
* the selected value.
*/
clearable: PropTypes.bool,

/**
Expand Down

0 comments on commit 3d00e17

Please sign in to comment.