import startOfISOWeekYear from '../startOfISOWeekYear/index' ; import addWeeks from '../addWeeks/index' ; import requiredArgs from '../_lib/requiredArgs/index' ; const MILLISECONDS_IN_WEEK = 604800000 ; name category summary description param { Date | Number } date returns { Number } throws example export default function getISOWeeksInYear ( dirtyDate ) { requiredArgs ( 1 , arguments ) ; const thisYear = startOfISOWeekYear ( dirtyDate ) ; const nextYear = startOfISOWeekYear ( addWeeks ( thisYear , 60 ) ) ; const diff = nextYear . valueOf ( ) - thisYear . valueOf ( ) ; return Math . round ( diff / MILLISECONDS_IN_WEEK ) ; }