getSingle method

int getSingle(
  1. DateType dateType
)

Implementation

int getSingle(DateType dateType) {
  switch (dateType) {
    case DateType.Year:
      return this.year ?? 0;
    case DateType.Month:
      return this.month ?? 0;
    case DateType.Day:
      return this.day ?? 0;
    case DateType.Hour:
      return this.hour ?? 0;
    case DateType.Minute:
      return this.minute ?? 0;
    case DateType.Second:
      return this.second ?? 0;
  }
}