import toInteger from '../_lib/toInteger/index' ; import toDate from '../toDate/index' ; import addDays from '../addDays/index' ; import getISODay from '../getISODay/index' ; import requiredArgs from '../_lib/requiredArgs/index' ; name category summary description param { Date | Number } date param { Number } day returns { Date } throws example export default function setISODay ( dirtyDate , dirtyDay ) { requiredArgs ( 2 , arguments ) ; const date = toDate ( dirtyDate ) ; const day = toInteger ( dirtyDay ) ; const currentDay = getISODay ( date ) ; const diff = day - currentDay ; return addDays ( date , diff ) ; }