输入:date = "2019-01-09"
输出:9
输入:date = "2019-02-10"
输出:41
输入:date = "2003-03-01"
输出:60
输入:date = "2004-03-01"
输出:61
/**
* @param {string} date
* @return {number}
*/
var dayOfYear = function (date) {
const dateObj = new Date(date);
const year = dateObj.getFullYear();
const firstOfYear = new Date(`${year}-01-01`);
return ((dateObj - firstOfYear) / 3600000 / 24) + 1
};