Suzzie's: fix day of week, guess if something is a soup

This commit is contained in:
zvon 2020-09-20 16:31:24 +02:00
parent 2116c20519
commit 76c1748f79

View File

@ -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);
}
}
}