Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated React version and added option to get the current month's data #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

moisesynfam
Copy link

No description provided.

Copy link
Owner

@lrojas94 lrojas94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing unit tests, which is the most crucial thing here. Also left out quite some comments & console logs around, which I'd advise you to avoid.

};
}

componentDidUpdate( prevProps, prevState) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this entire method, it's doing nothing really.

@@ -51,6 +64,36 @@ export default class Calendar extends React.Component {
);
}

// _verifyWeeksChange( weeks ) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for this to be commented out? If not needed, remove please.

@@ -60,10 +103,17 @@ export default class Calendar extends React.Component {
const {
timeslots,
initialDate,
onMonthChange
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prop is not being used here, I only see it in this._onMonthChange, so it's an unused var.

// this.setState({
// weeksStart: weeks[0],
// weeksEnd: weeks[weeks.length - 1]
// });
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all this comments.

@@ -45,6 +45,7 @@ export default class App extends React.Component {
console.log('Last selected timeslot:');
console.log(lastSelected);
} }
onMonthChange = { (month) => {console.log(month)}}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no point on doing this (?). If what you're looking to see is whether this works or not, write unit tests instead.

this.startDate = startDate;
this.endDate = endDate;

this.props.onMonthChange({ startDate, endDate });
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use destructuring here:
const { onMonthChange } = this.props

// }

_onMonthChange(weeks) {
const startingWeek = weeks[0];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const [startingWeek] = weeks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants