mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-04 10:43:19 +00:00
Add current time indicator of the current day on the Calendar
This commit is contained in:
parent
ab2200ecc1
commit
e2cd994026
9 changed files with 54 additions and 8 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "Utils.h"
|
||||
#include <cctype>
|
||||
#include <chrono>
|
||||
#include <format>
|
||||
#include <string>
|
||||
|
||||
|
@ -19,6 +20,12 @@ void bindSlintUtils(const ui::Utils &utils)
|
|||
};
|
||||
return std::format("{:%B %d}", chronoDate);
|
||||
});
|
||||
|
||||
auto currentDate = MiraiDateToSlintDate(mirai::Date(std::chrono::system_clock::now()));
|
||||
utils.set_current_date(currentDate);
|
||||
|
||||
auto currentTime = MiraiTimeToSlintTime(mirai::Time(std::chrono::system_clock::now()));
|
||||
utils.set_current_time(currentTime);
|
||||
}
|
||||
|
||||
std::string formatZeroPadding(const int number)
|
||||
|
@ -81,5 +88,5 @@ ui::Time MiraiTimeToSlintTime(const mirai::Time &time)
|
|||
|
||||
mirai::Time SlintTimeToMiraiTime(const ui::Time &time)
|
||||
{
|
||||
return {.hour = time.hour, .minute = time.minute};
|
||||
return mirai::Time{time.hour, time.minute};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue