hasSame(otherDateTime, unit, opts) {
    if (!this.isValid) return false;

    const inputMs = otherDateTime.valueOf();
    const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });
    return (
      adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)
    );
  }
Return whether this DateTime is in the same unit of time as another DateTime.
Higher-order units must also be identical for this function to return `true`.
Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.
@param {DateTime} otherDateTime - the other DateTime
@param {string} unit - the unit of time to check sameness on
@param {Object} opts - options
@param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used
@example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day
@return {boolean}