months method

  1. @override
String months(
  1. int months
)
override

Format when time is in months

Implementation

@override
String months(int months) {
  if (months % 100 == 11 ||
      months % 100 == 12 ||
      months % 100 == 13 ||
      months % 100 == 14) {
    return '$months mjeseci';
  }

  if (months % 10 == 1) return '$months mjesec';

  if (months % 10 == 2 || months % 10 == 3 || months % 4 == 0) {
    return '$months mjeseca';
  }

  return '$months mjeseci';
}