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 bb8f8df commit 66af378
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
10 changes: 4 additions & 6 deletions build/MonthView/Day.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,20 @@ var className = 'react-calendar__month-view__days__day';

var Day = function Day(_ref) {
var active = _ref.active,
calendarType = _ref.calendarType,
currentMonthIndex = _ref.currentMonthIndex,
date = _ref.date,
maxDate = _ref.maxDate,
minDate = _ref.minDate,
onChange = _ref.onChange;
return _react2.default.createElement(
'button',
{
className: [className, 'react-calendar__tile', active ? 'react-calendar__tile--active' : '', (0, _dates.isWeekend)(date) ? className + '--weekend' : ''].join(' '),
className: [className, 'react-calendar__tile', active ? 'react-calendar__tile--active' : '', (0, _dates.isWeekend)(date) ? className + '--weekend' : '', date.getMonth() !== currentMonthIndex ? className + '--neighboringMonth' : ''].join(' '),
disabled: minDate && (0, _dates.getBeginOfDay)(minDate) > date || maxDate && (0, _dates.getEndOfDay)(maxDate) < date,
key: date,
onClick: onChange && function () {
return onChange(date);
},
style: (0, _dates.getDay)(date) === 1 ? {
gridColumnStart: (0, _dates.getDayOfWeek)(date, calendarType) + 1
} : null
}
},
_react2.default.createElement(
'time',
Expand All @@ -51,6 +48,7 @@ var Day = function Day(_ref) {
Day.propTypes = {
active: _propTypes2.default.bool.isRequired,
calendarType: _propTypes3.isCalendarType,
currentMonthIndex: _propTypes2.default.number.isRequired,
date: _propTypes2.default.instanceOf(Date).isRequired,
maxDate: _propTypes3.isMaxDate,
minDate: _propTypes3.isMinDate,
Expand Down
33 changes: 21 additions & 12 deletions build/MonthView/Days.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,26 @@ var Days = function (_Component) {
_inherits(Days, _Component);

function Days() {
var _ref;

var _temp, _this, _ret;

_classCallCheck(this, Days);

for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Days.__proto__ || Object.getPrototypeOf(Days)).call.apply(_ref, [this].concat(args))), _this), _this.start = 1, _temp), _possibleConstructorReturn(_this, _ret);
return _possibleConstructorReturn(this, (Days.__proto__ || Object.getPrototypeOf(Days)).apply(this, arguments));
}

_createClass(Days, [{
key: 'getDayOfWeek',
value: function getDayOfWeek(date) {
var calendarType = this.props.calendarType;

return (0, _dates.getDayOfWeek)(date, calendarType);
}
}, {
key: 'render',
value: function render() {
var start = this.start,
end = this.end,
year = this.year,
monthIndex = this.monthIndex;
var _props = this.props,
calendarType = _props.calendarType,
maxDate = _props.maxDate,
minDate = _props.minDate,
onChange = _props.onChange,
Expand All @@ -76,7 +74,7 @@ var Days = function (_Component) {
var date = new Date(year, monthIndex, day);

days.push(_react2.default.createElement(_Day2.default, _extends({}, (0, _utils.getTileActivityFlags)(value, valueType, date, 'day'), {
calendarType: calendarType,
currentMonthIndex: monthIndex,
date: date,
maxDate: maxDate,
minDate: minDate,
Expand All @@ -95,12 +93,23 @@ var Days = function (_Component) {
days
);
}
}, {
key: 'start',
get: function get() {
var activeStartDate = this.props.activeStartDate;

return -this.getDayOfWeek(activeStartDate) + 1;
}
}, {
key: 'end',
get: function get() {
var activeStartDate = this.props.activeStartDate;
var year = this.year,
monthIndex = this.monthIndex;

return (0, _dates.getDaysInMonth)(activeStartDate);
var daysInMonth = (0, _dates.getDaysInMonth)(activeStartDate);
var activeEndDate = new Date(year, monthIndex, daysInMonth);
return (0, _dates.getDaysInMonth)(activeStartDate) + (7 - this.getDayOfWeek(activeEndDate) - 1);
}
}, {
key: 'year',
Expand Down

0 comments on commit 66af378

Please sign in to comment.