获得差值。
function dayOfYear(date: string): number { const handleDate = new Date(date) return Math.floor((handleDate.getTime() - new Date(handleDate.getFullYear(), 0, 0).getTime()) / 1000 / 60 / 60 / 24) }