~aleteoryx/muditaos

c209338ade721d6a82e41bb0e36d0aeb31026e24 — Mateusz Piesta 3 years ago 508d6b8
[BH-1487] Seconds are not set to zero

When setting the new time from the settings application,
zero current seconds counter to have time set precisely.
1 files changed, 3 insertions(+), 2 deletions(-)

M products/BellHybrid/apps/application-bell-settings/models/TimeUnitsModel.cpp
M products/BellHybrid/apps/application-bell-settings/models/TimeUnitsModel.cpp => products/BellHybrid/apps/application-bell-settings/models/TimeUnitsModel.cpp +3 -2
@@ 74,13 74,14 @@ namespace app::bell_settings
    void TimeUnitsModel::saveData()
    {
        const auto newTime = timeSetListItem->timeSetFmtSpinner->getTime();
        const auto time_tm = std::localtime(&newTime);
        auto time_tm       = std::localtime(&newTime);
        const auto newFmt  = timeFmtSetListItem->getTimeFmt();
        LOG_INFO("Setting new time: %d:%d fmt: %s",
                 time_tm->tm_hour,
                 time_tm->tm_min,
                 utils::time::Locale::format(newFmt).c_str());
        sendRtcUpdateTimeMessage(newTime);
        time_tm->tm_sec = 0;
        sendRtcUpdateTimeMessage(std::mktime(time_tm));
        sendTimeFmtUpdateMessage(newFmt);
    }