-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
Thanks! Ill take a look tomorrow On Thu, Oct 13, 2016, 21:18 Coveralls notifications@github.com wrote:
|
This is looking super cool, thanks a lot! Thanks a bunch, have a nice one! |
// TODO: this needs to be improved since some years have 52 weeks | ||
const MAX_WEEK = 53 | ||
export default function weekValidator(control) { | ||
function weekValidator(control) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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?
No description provided.