From 774918c5d124f0fa6c6f3b3a3c26f4d9892cdb93 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 13 Sep 2023 01:27:56 +0800 Subject: [PATCH] More stringently check for min and max date validity in date field backend Signed-off-by: Claudio Cambra --- src/gui/filedetails/datefieldbackend.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/filedetails/datefieldbackend.cpp b/src/gui/filedetails/datefieldbackend.cpp index 0b806547cced7..036ee7ee8302d 100644 --- a/src/gui/filedetails/datefieldbackend.cpp +++ b/src/gui/filedetails/datefieldbackend.cpp @@ -170,11 +170,11 @@ bool DateFieldBackend::validDate() const { auto valid = _date.isValid(); - if (_minimumDate.isValid()) { + if (_minimumDate.isValid() && minimumDateMsecs() > 0) { valid &= _date >= _minimumDate; } - if (_maximumDate.isValid()) { + if (_maximumDate.isValid() && maximumDateMsecs() > 0) { valid &= _date <= _maximumDate; }