diff -r d869ff924c19 -r e714005f3e9d src/html.cpp --- a/src/html.cpp Sat Feb 01 14:11:46 2025 +0100 +++ b/src/html.cpp Sat Feb 01 14:19:36 2025 +0100 @@ -26,8 +26,7 @@ #include -namespace chrono = std::chrono; -using chrono::operator ""d; +using namespace std::chrono; namespace html { static constexpr const char* weekdays[] = {"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"}; @@ -135,22 +134,22 @@ printf("

%s

\n", encode(heading).c_str()); } -void html::table_begin(int year) { +void html::table_begin(year y) { static constexpr const char* months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; // compute the column spans, first unsigned colspans[12] = {}; { unsigned total_cols = 0; - chrono::sys_days day{chrono::year_month_day{chrono::year{year}, chrono::January, 1d}}; - if (chrono::weekday{day}.iso_encoding() != 1) { + sys_days day{year_month_day{y, January, 1d}}; + if (weekday{day}.iso_encoding() != 1) { colspans[0] = 1; total_cols = 1; } for (unsigned col = 0; col < 12; ++col) { - while (total_cols < html::columns && chrono::year_month_day{day}.month() <= chrono::month{col + 1}) { + while (total_cols < html::columns && year_month_day{day}.month() <= month{col + 1}) { ++total_cols; ++colspans[col]; - day += chrono::days{7}; + day += days{7}; } } } @@ -193,7 +192,7 @@ puts(""); } -void html::cell(std::chrono::year_month_day ymd, unsigned commits) { +void html::cell(year_month_day ymd, unsigned commits) { const char *color_class; if (commits == 0) { color_class = "zero-commits"; @@ -211,7 +210,7 @@ indent(); printf("\n", color_class, - weekdays[chrono::weekday(ymd).iso_encoding() - 1], + weekdays[weekday(ymd).iso_encoding() - 1], static_cast(ymd.year()), static_cast(ymd.month()), static_cast(ymd.day()),