import toInteger from '../_lib/toInteger/index' ; import toDate from '../toDate/index' ; import getISOWeek from '../getISOWeek/index' ; import requiredArgs from '../_lib/requiredArgs/index' ; name category summary description param { Date | Number } date param { Number } isoWeek returns { Date } throws example export default function setISOWeek ( dirtyDate , dirtyISOWeek ) { requiredArgs ( 2 , arguments ) ; const date = toDate ( dirtyDate ) ; const isoWeek = toInteger ( dirtyISOWeek ) ; const diff = getISOWeek ( date ) - isoWeek ; date . setDate ( date . getDate ( ) - diff * 7 ) ; return date ; }