kopia lustrzana https://gitlab.com/tomaszg/geostat
Show day of the week stats
rodzic
ad98624734
commit
e20dbd2f48
|
@ -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;
|
||||
|
|
1
cache.h
1
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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue