KWidgetsAddons

kdaterangecontrol.cpp
1/*
2 SPDX-FileCopyrightText: 2011 John Layt <john@layt.net>
3 SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "kdaterangecontrol_p.h"
8
9bool KDateRangeControlPrivate::isInDateRange(const QDate &date) const
10{
11 return date.isValid() //
12 && (!m_minDate.isValid() || date >= m_minDate) //
13 && (!m_maxDate.isValid() || date <= m_maxDate);
14}
15
16bool KDateRangeControlPrivate::setDateRange(const QDate &minDate, const QDate &maxDate)
17{
18 if (minDate.isValid() && maxDate.isValid() && minDate > maxDate) {
19 return false;
20 }
21
22 m_minDate = minDate;
23 m_maxDate = maxDate;
24 return true;
25}
bool isValid(int year, int month, int day)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.