hourStr_12h property

String get hourStr_12h

Returns hour (converted to 12h time) as a two digit string, padded with a leading zero if necessary.

Implementation

String get hourStr_12h {
  final int hour = this.hour % 12;
  return hour == 0 ? '12' : hour.toString().padLeft(2, '0');
}