timeString property

String timeString

Gets the time string.

If it is all day, it will be displayed as all day.

If there is no end time, only the start time is displayed.

Implementation

String get timeString {
  if (allDay) {
    return "All day".localize();
  }
  final tmp =
      "${startTime.hour.format("00")}:${startTime.minute.format("00")} -";
  if (endTime == null ||
      startTime.millisecondsSinceEpoch >= endTime!.millisecondsSinceEpoch) {
    return tmp;
  }
  return "$tmp ${endTime!.hour.format("00")}:${endTime!.minute.format("00")}";
}