import toDate from '../toDate/index' ; import startOfYear from '../startOfYear/index' ; import differenceInCalendarDays from '../differenceInCalendarDays/index' ; import requiredArgs from '../_lib/requiredArgs/index' ; name category summary description param { Date | Number } date returns { Number } throws example export default function getDayOfYear ( dirtyDate ) { requiredArgs ( 1 , arguments ) ; const date = toDate ( dirtyDate ) ; const diff = differenceInCalendarDays ( date , startOfYear ( date ) ) ; const dayOfYear = diff + 1 ; return dayOfYear ; }