function setEndDate(rangeBar, value) {
  if (Array.isArray(rangeBar)) {
    rangeBar[2] = value;
  } else {
    rangeBar.endDate = value;
  }
}
Set the end date of the provided range bar.

@param {Object} rangeBar The range bar object.
@param {Date} value The new end date value.