code: function lastDayOfMonth(time) {
    let year = time.getUTCFullYear()
    let nextMonth = time.getUTCMonth() + 2
    if (nextMonth > 12) {
      year++
      nextMonth = 1
    }
    let nextMonthStr = String(nextMonth)
    if (nextMonthStr.length === 1) { nextMonthStr = '0' + nextMonthStr }
    let date = new Date(`${year}-${nextMonthStr}-01T00:00:00Z`)
    return (new Date(+date - 1000)).getUTCDate()
  }
docs: Takes a Date, returns the date of the last day of the corresponding month. eg, 31.