endOf method

Moment endOf(
  1. DurationUnit unit
)

Returned object will have same timezone as this

Implementation

Moment endOf(DurationUnit unit) {
  switch (unit) {
    case DurationUnit.week:
      return endOfLocalWeek();

    case DurationUnit.microsecond:
    case DurationUnit.millisecond:
    case DurationUnit.second:
    case DurationUnit.minute:
    case DurationUnit.hour:
    case DurationUnit.day:
    case DurationUnit.month:
    case DurationUnit.year:
      return forcedSuperType
          .endOf(unit)
          .toMoment(localization: setLocalization);
  }
}