A function that returns a Date object of the first month in a year.
Date
Copy CodefirstMonthOfYear(new Date(2017, 11, 1)); // 2017-1-1 firstMonthOfYear(new Date(2017, 0, 1)); // 2017-1-1
firstMonthOfYear(new Date(2017, 11, 1)); // 2017-1-1 firstMonthOfYear(new Date(2017, 0, 1)); // 2017-1-1
Date - The first month in a year.