function getLastDateOfMonth(date) {
      return new Date(date.getFullYear(), date.getMonth(), getNumberOfDaysInMonth(date));
    }
Gets the last day of the month for the given date.
@param {Date} date
@returns {Date}