import toDate from '../toDate/index' ; import requiredArgs from '../_lib/requiredArgs/index' ; name category summary description param { Date | Number } date returns { Date } throws example export default function startOfQuarter ( dirtyDate ) { requiredArgs ( 1 , arguments ) ; const date = toDate ( dirtyDate ) ; const currentMonth = date . getMonth ( ) ; const month = currentMonth - ( currentMonth % 3 ) ; date . setMonth ( month , 1 ) ; date . setHours ( 0 , 0 , 0 , 0 ) ; return date ; }