diff options
Diffstat (limited to 'src/openvic-simulation/history/Period.cpp')
-rw-r--r-- | src/openvic-simulation/history/Period.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/openvic-simulation/history/Period.cpp b/src/openvic-simulation/history/Period.cpp index 2c6589c..b5a9c82 100644 --- a/src/openvic-simulation/history/Period.cpp +++ b/src/openvic-simulation/history/Period.cpp @@ -5,15 +5,15 @@ using namespace OpenVic; Period::Period( - const Date new_start_date, - const std::optional<Date> new_end_date + Date new_start_date, + std::optional<Date> new_end_date ) : start_date { new_start_date }, end_date { new_end_date } {} -bool Period::is_date_in_period(const Date date) const { +bool Period::is_date_in_period(Date date) const { return start_date <= date && (!end_date.has_value() || end_date.value() >= date); } -bool Period::try_set_end(const Date date) { +bool Period::try_set_end(Date date) { if (end_date.has_value()) { Logger::error("Period already has end date ", end_date.value()); return false; |