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 endOfMonth ( dirtyDate ) { requiredArgs ( 1 , arguments ) ; const date = toDate ( dirtyDate ) ; const month = date . getMonth ( ) ; date . setFullYear ( date . getFullYear ( ) , month + 1 , 0 ) ; date . setHours ( 23 , 59 , 59 , 999 ) ; return date ; }