import toDate from '../../toDate/index' ; import startOfUTCISOWeek from '../startOfUTCISOWeek/index' ; import startOfUTCISOWeekYear from '../startOfUTCISOWeekYear/index' ; import requiredArgs from '../requiredArgs/index' ; const MILLISECONDS_IN_WEEK = 604800000 ; export default function getUTCISOWeek ( dirtyDate ) { requiredArgs ( 1 , arguments ) ; const date = toDate ( dirtyDate ) ; const diff = startOfUTCISOWeek ( date ) . getTime ( ) - startOfUTCISOWeekYear ( date ) . getTime ( ) ; return Math . round ( diff / MILLISECONDS_IN_WEEK ) + 1 ; }