Skip to content

Commit

Permalink
Update compiled files
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Aug 28, 2017
1 parent 4920fb2 commit 95759c1
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 8 deletions.
6 changes: 4 additions & 2 deletions build/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,12 @@ var Calendar = function (_Component) {
activeRange: this.state.activeRange,
activeStartDate: this.state.activeStartDate,
drillUp: this.drillUp,
nextLabel: this.props.nextLabel,
maxDate: this.props.maxDate,
minDate: this.props.minDate,
next2Label: this.props.next2Label,
prevLabel: this.props.prevLabel,
nextLabel: this.props.nextLabel,
prev2Label: this.props.prev2Label,
prevLabel: this.props.prevLabel,
setActiveStartDate: this.setActiveStartDate,
view: this.state.view,
views: this.getLimitedViews()
Expand Down
6 changes: 5 additions & 1 deletion build/Calendar.less
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
background-color: rgb(230, 230, 230);
}
}

&[disabled] {
background-color: rgb(240, 240, 240);
}
}

&__label {
Expand Down Expand Up @@ -120,4 +124,4 @@
}
}
}
}
}
44 changes: 39 additions & 5 deletions build/Calendar/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,15 @@ var Navigation = function (_Component) {
_react2.default.createElement(
'button',
{
disabled: this.nextButtonDisabled,
onClick: this.onClickNext
},
this.props.nextLabel
),
view !== 'century' && _react2.default.createElement(
'button',
{
disabled: this.next2ButtonDisabled,
onClick: this.onClickNext2
},
this.props.next2Label
Expand Down Expand Up @@ -147,28 +149,58 @@ var Navigation = function (_Component) {
get: function get() {
var _props4 = this.props,
date = _props4.activeStartDate,
minDate = _props4.minDate,
view = _props4.view;

var nextActiveStartDate = (0, _dates.getBeginPrevious)(view, date);
return nextActiveStartDate.getFullYear() < 1000;
var previousActiveStartDate = (0, _dates.getBeginPrevious)(view, date);
if (previousActiveStartDate.getFullYear() < 1000) {
return true;
}
return minDate && minDate >= previousActiveStartDate;
}
}, {
key: 'prev2ButtonDisabled',
get: function get() {
var _props5 = this.props,
date = _props5.activeStartDate,
minDate = _props5.minDate,
view = _props5.view;

var nextActiveStartDate = (0, _dates.getBeginPrevious2)(view, date);
return nextActiveStartDate.getFullYear() < 1000;
var previousActiveStartDate = (0, _dates.getBeginPrevious2)(view, date);
if (previousActiveStartDate.getFullYear() < 1000) {
return true;
}
return minDate && minDate >= previousActiveStartDate;
}
}, {
key: 'label',
key: 'nextButtonDisabled',
get: function get() {
var _props6 = this.props,
date = _props6.activeStartDate,
maxDate = _props6.maxDate,
view = _props6.view;

var nextActiveStartDate = (0, _dates.getBeginNext)(view, date);
return maxDate && maxDate <= nextActiveStartDate;
}
}, {
key: 'next2ButtonDisabled',
get: function get() {
var _props7 = this.props,
date = _props7.activeStartDate,
maxDate = _props7.maxDate,
view = _props7.view;

var nextActiveStartDate = (0, _dates.getBeginNext2)(view, date);
return maxDate && maxDate <= nextActiveStartDate;
}
}, {
key: 'label',
get: function get() {
var _props8 = this.props,
date = _props8.activeStartDate,
view = _props8.view;


switch (view) {
case 'century':
Expand Down Expand Up @@ -203,6 +235,8 @@ var viewPropType = _propTypes2.default.oneOf(allViews);
Navigation.propTypes = {
activeStartDate: _propTypes2.default.instanceOf(Date).isRequired,
drillUp: _propTypes2.default.func.isRequired,
maxDate: _propTypes2.default.instanceOf(Date),
minDate: _propTypes2.default.instanceOf(Date),
next2Label: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.node]),
nextLabel: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.node]),
prev2Label: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.node]),
Expand Down

0 comments on commit 95759c1

Please sign in to comment.