formatResetStamp function

String formatResetStamp(
  1. DateTime at, {
  2. String localeCode = 'en',
})

The absolute reset stamp in human units («19 октября в 22:49» / October 19, 22:49). Pass the moment already converted to the wall clock it should render in (the caller does resetsAt.toLocal()).

Implementation

String formatResetStamp(DateTime at, {String localeCode = 'en'}) {
  final ru = localeCode.toLowerCase().startsWith('ru');
  final hh = at.hour.toString().padLeft(2, '0');
  final mm = at.minute.toString().padLeft(2, '0');
  return ru
      ? '${at.day} ${_ruMonths[at.month - 1]} в $hh:$mm'
      : '${_enMonths[at.month - 1]} ${at.day}, $hh:$mm';
}