ui/map: fix wrong remaining time (#28960)

old-commit-hash: 53934c7fee
beeps
Dean Lee 2 years ago committed by GitHub
parent b81910128d
commit cba02f9a59
  1. 5
      selfdrive/ui/qt/maps/map.cc

@ -548,9 +548,8 @@ void MapETA::updateETA(float s, float s_typical, float d) {
: std::array{eta_t.toString("h:mm a").split(' ')[0], eta_t.toString("a")};
// Remaining time
auto time_t = QDateTime::fromTime_t(s);
auto remaining = s < 3600 ? std::array{time_t.toString("m"), tr("min")}
: std::array{time_t.toString("h:mm"), tr("hr")};
auto remaining = s < 3600 ? std::array{QString::number(int(s / 60)), tr("min")}
: std::array{QString("%1:%2").arg((int)s / 3600).arg(((int)s % 3600) / 60, 2, 10, QLatin1Char('0')), tr("hr")};
QString color = "#25DA6E";
if (s / s_typical > 1.5) color = "#DA3025";
else if (s / s_typical > 1.2) color = "#DAA725";

Loading…
Cancel
Save