ISSUE#1877 Calendar week numbers

1. Let's do code simplier
2. Week format using regexp. Needs when user provide additional
characters in format string and need to align week days according
3. Week format has got default formats: ":%U",":%V"
4. Week number is based on the first day of the week now. The output is
the same as of date library now.
5. Avoiding of unnecessary operations
This commit is contained in:
Viktar Lukashonak
2022-12-10 14:02:15 +03:00
parent c5babb4c44
commit 57ad7f9536
2 changed files with 45 additions and 41 deletions

View File

@ -33,6 +33,8 @@ class Clock : public ALabel {
bool handleScroll(GdkEventScroll* e);
std::string weeks_format_;
int weeks_format_left_gaps{0};
auto calendar_text(const waybar_time& wtime) -> std::string;
auto weekdays_header(const date::weekday& first_dow, std::ostream& os) -> void;
auto first_day_of_week() -> date::weekday;