Commit 1e607757 authored by Volker Krause's avatar Volker Krause
Browse files

Fix time range validation

Clipping to future events needs to happen above this, otherwise this
messes with change tracking.
parent 2e1c9c8b
......@@ -31,12 +31,12 @@ void OpeningHoursCache::setMapData(const MapData &mapData)
void OpeningHoursCache::setTimeRange(const QDateTime &begin, const QDateTime &end)
{
if ((begin == m_begin || begin < QDateTime::currentDateTime()) && end == m_end) {
if (begin == m_begin && end == m_end) {
return;
}
m_begin = std::max(begin, QDateTime::currentDateTime());
m_end = end;
m_begin = begin.isValid() ? begin : QDateTime::currentDateTime();
m_end = (end > m_begin) ? end : QDateTime();
m_cacheEntries.clear();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment