diff --git a/cache.cpp b/cache.cpp index e24657c..3f0f428 100644 --- a/cache.cpp +++ b/cache.cpp @@ -26,12 +26,15 @@ void Cache::set_date(std::tm* t) { char tmp[20]; date_tm = *t; + std::mktime(&date_tm); year = std::to_string(1900+date_tm.tm_year); std::strftime(tmp, 20, "(%m) %B", &date_tm); mon = tmp; day = std::to_string(date_tm.tm_mday); hour = std::to_string(date_tm.tm_hour); + std::strftime(tmp, 20, "(%u) %A", &date_tm); + day_of_week = tmp; std::strftime(tmp, 20, "%F", &date_tm); date = tmp; diff --git a/cache.h b/cache.h index c4cd07c..7366645 100644 --- a/cache.h +++ b/cache.h @@ -59,6 +59,7 @@ public: std::string mon; std::string day; std::string hour; + std::string day_of_week; std::string date; void set_date(std::tm* t); diff --git a/geostat.cpp b/geostat.cpp index cf450f8..2812a86 100644 --- a/geostat.cpp +++ b/geostat.cpp @@ -351,6 +351,7 @@ int main(int argc, char** argv) { } if ((show_calendar || show_html) && !get_not_found) { + show_histogram(&cc, &Cache::day_of_week, "Days of the week", show_html, 0); show_histogram(&cc, &Cache::mon, "Months", show_html, 0); show_histogram(&cc, &Cache::year, "Years", show_html, 0); }