shortUnitLabel method

String shortUnitLabel(
  1. FuzzyTimeUnit unit
)

Helper to return a localized short unit label.

Implementation

String shortUnitLabel(FuzzyTimeUnit unit) {
  return switch (unit) {
    FuzzyTimeUnit.second => secondShort,
    FuzzyTimeUnit.minute => minuteShort,
    FuzzyTimeUnit.hour => hourShort,
    FuzzyTimeUnit.day => dayShort,
    FuzzyTimeUnit.week => weekShort,
    FuzzyTimeUnit.month => monthShort,
    FuzzyTimeUnit.year => yearShort,
  };
}