From 76c1748f797036f452fc5256c3c676709fa9827b Mon Sep 17 00:00:00 2001 From: zvon Date: Sun, 20 Sep 2020 16:31:24 +0200 Subject: [PATCH] Suzzie's: fix day of week, guess if something is a soup --- restaurants/suzzies.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/restaurants/suzzies.cpp b/restaurants/suzzies.cpp index 89a7fe4..45894f8 100644 --- a/restaurants/suzzies.cpp +++ b/restaurants/suzzies.cpp @@ -11,7 +11,7 @@ LunchRest::SuzziesRestaurant::SuzziesRestaurant() : Restaurant("https://develope int weekDay(const std::string &date_str) { struct tm date_tm; strptime(date_str.c_str(), "%Y-%m-%d %H:%M:%S", &date_tm); - return (date_tm.tm_wday + 1) % 7; + return (date_tm.tm_wday + 6) % 7; } void LunchRest::SuzziesRestaurant::parse() { @@ -36,7 +36,8 @@ void LunchRest::SuzziesRestaurant::parse() { for(size_t j = 0; j < meals.Size(); j++) { const auto &meal = meals[j]["dish"]; if(strlen(meal["price"].GetString()) != 0) { - menus[week_day].addMeal(false, meal["name"].GetString(), "", std::stoi(meal["price"].GetString())); + auto price = std::stoi(meal["price"].GetString()); + menus[week_day].addMeal(price < 100, meal["name"].GetString(), "", price); } } }