Remove support for iso duration and fix bolt (#235)

This commit is contained in:
Kostas Kyrimis
2021-09-17 17:40:57 +03:00
committed by Antonio Andelic
parent da68f86fc9
commit 8ea281649a
12 changed files with 93 additions and 213 deletions

View File

@@ -279,14 +279,8 @@ class ExpressionEvaluator : public ExpressionVisitor<TypedValue> {
return std::nullopt;
};
auto maybe_duration = [this](const auto &dur, const auto &prop_name) -> std::optional<TypedValue> {
if (prop_name == "years") {
return TypedValue(dur.Years(), ctx_->memory);
}
if (prop_name == "months") {
return TypedValue(dur.Months(), ctx_->memory);
}
if (prop_name == "days") {
return TypedValue(dur.SubMonthsAsDays(), ctx_->memory);
return TypedValue(dur.Days(), ctx_->memory);
}
if (prop_name == "hours") {
return TypedValue(dur.SubDaysAsHours(), ctx_->memory);