Merge pull request #1555 from LukashonakV/ISSUE#1552
Calendar module: localization issue #1552pull/1566/head
commit
38a846ae51
|
@ -230,12 +230,14 @@ auto waybar::modules::Clock::calendar_text(const waybar_time& wtime) -> std::str
|
||||||
} else
|
} else
|
||||||
os << date::format("%e", d);
|
os << date::format("%e", d);
|
||||||
/*Print weeks on the right when the endings with spaces*/
|
/*Print weeks on the right when the endings with spaces*/
|
||||||
if (ws == 2 && d == last_day && wd.c_encoding() < 6) {
|
if (ws == 2 && d == last_day) {
|
||||||
empty_days = 6 - wd.c_encoding();
|
empty_days = 6 - (wd.c_encoding() - first_dow.c_encoding());
|
||||||
|
if (empty_days > 0) {
|
||||||
os << std::string(empty_days * 3 + 1, ' ');
|
os << std::string(empty_days * 3 + 1, ' ');
|
||||||
print_iso_weeknum(os, wn);
|
print_iso_weeknum(os, wn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auto result = os.str();
|
auto result = os.str();
|
||||||
cached_calendar_ymd_ = ymd;
|
cached_calendar_ymd_ = ymd;
|
||||||
|
@ -291,7 +293,7 @@ auto waybar::modules::Clock::timezones_text(std::chrono::system_clock::time_poin
|
||||||
|
|
||||||
auto waybar::modules::Clock::print_iso_weeknum(std::ostream& os, int weeknum) -> void {
|
auto waybar::modules::Clock::print_iso_weeknum(std::ostream& os, int weeknum) -> void {
|
||||||
std::stringstream res;
|
std::stringstream res;
|
||||||
res << 'W' << std::setfill('0') << std::setw(2) << weeknum;
|
res << std::setfill('0') << std::setw(2) << weeknum;
|
||||||
|
|
||||||
if (config_["format-calendar-weeks"].isString()) {
|
if (config_["format-calendar-weeks"].isString()) {
|
||||||
os << fmt::format(config_["format-calendar-weeks"].asString(), res.str());
|
os << fmt::format(config_["format-calendar-weeks"].asString(), res.str());
|
||||||
|
|
Loading…
Reference in New Issue