mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-12-22 13:29:48 +01:00
widget: show 12AM instead of 0AM
This commit is contained in:
parent
eadcbc0aed
commit
c3c28feb4c
1 changed files with 1 additions and 1 deletions
|
@ -138,7 +138,7 @@ static std::string getTime12h() {
|
||||||
|
|
||||||
const auto HRS = hhmmss.hours().count();
|
const auto HRS = hhmmss.hours().count();
|
||||||
const auto MINS = hhmmss.minutes().count();
|
const auto MINS = hhmmss.minutes().count();
|
||||||
return (HRS == 12 ? "12" : (HRS % 12 < 10 ? "0" : "") + std::to_string(HRS % 12)) + ":" + (MINS < 10 ? "0" : "") + std::to_string(MINS) + (HRS < 12 ? " AM" : " PM");
|
return (HRS == 12 || HRS == 0 ? "12" : (HRS % 12 < 10 ? "0" : "") + std::to_string(HRS % 12)) + ":" + (MINS < 10 ? "0" : "") + std::to_string(MINS) + (HRS < 12 ? " AM" : " PM");
|
||||||
}
|
}
|
||||||
|
|
||||||
IWidget::SFormatResult IWidget::formatString(std::string in) {
|
IWidget::SFormatResult IWidget::formatString(std::string in) {
|
||||||
|
|
Loading…
Reference in a new issue