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

#8: calculating weeks in year with tests. #12

Merged
merged 2 commits into from
Oct 15, 2016

Conversation

babruix
Copy link
Contributor

@babruix babruix commented Oct 14, 2016

No description provided.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 84.337% when pulling bc798ba on babruix:master into 4539f9f on franleplant:master.

@franleplant
Copy link
Owner

Thanks! Ill take a look tomorrow

On Thu, Oct 13, 2016, 21:18 Coveralls notifications@github.com wrote:

[image: Coverage Status] https://coveralls.io/builds/8330888

Coverage increased (+0.4%) to 84.337% when pulling bc798ba
bc798ba
on babruix:master
into 4539f9f
4539f9f
on franleplant:master
.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#12 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABxEJ_zl5Uy9KuWw59tXNCMc1bIKn9KWks5qzspKgaJpZM4KWg5X
.

@franleplant
Copy link
Owner

This is looking super cool, thanks a lot!
There only remains a few cosmetic changes, please push new commits to this branch and PR instead of closing and opening a new one.

Thanks a bunch, have a nice one!
Fran

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 84.049% when pulling 5a5bf61 on babruix:master into 4539f9f on franleplant:master.

// TODO: this needs to be improved since some years have 52 weeks
const MAX_WEEK = 53
export default function weekValidator(control) {
function weekValidator(control) {
Copy link
Owner

Choose a reason for hiding this comment

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

I would like to keep the export default function weekValidator

}

function weeksInYear(year) {
Copy link
Owner

Choose a reason for hiding this comment

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

change this to export function weeksInYear

return getWeekNumber(dayOfTheMonth)[1];
}

function getWeekNumber(d) {
Copy link
Owner

Choose a reason for hiding this comment

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

change this to export function getWeekNumber

return [date.getFullYear(), weekNo];
}

export {weekValidator as default, weeksInYear, getWeekNumber}
Copy link
Owner

Choose a reason for hiding this comment

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

And finally remove this

}

const dayOfTheMonth = lastDayOfTheYear.setDate(24);
return getWeekNumber(dayOfTheMonth)[1];
Copy link
Owner

Choose a reason for hiding this comment

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

Sorry to be minimalist here, but do you have any comments on what's happening here?

@franleplant franleplant merged commit 35d4dd6 into franleplant:master Oct 15, 2016
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.

None yet

3 participants