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 lastDayOfDecade ( dirtyDate ) { requiredArgs ( 1 , arguments ) ; const date = toDate ( dirtyDate ) ; const year = date . getFullYear ( ) ; const decade = 9 + Math . floor ( year / 10 ) * 10 ; date . setFullYear ( decade + 1 , 0 , 0 ) ; date . setHours ( 0 , 0 , 0 , 0 ) ; return date ; }