Skip to content

Commit

Permalink
More stringently check for min and max date validity in date field ba…
Browse files Browse the repository at this point in the history
…ckend

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
  • Loading branch information
claucambra authored and backportbot-nextcloud[bot] committed Sep 13, 2023
1 parent cdd8a75 commit c61814e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/filedetails/datefieldbackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c61814e

Please sign in to comment.