code: function getFirstWeekBegDay (year) {
    var tempdate = new Date(year, 0, 1)
    var temp = tempdate.getDay()
    if (temp === 1) {
      return tempdate
    }
    temp = temp === 0 ? 7 : temp
    tempdate = tempdate.setDate(tempdate.getDate() + (8 - temp))
    return new Date(tempdate)
  }
docs: 日期原型扩展