Revision 34233707
Von Christian Ehringfeld vor etwa 10 Jahren hinzugefügt
| src/validators/datevalidator.cpp | ||
|---|---|---|
|
if (date.isValid()) {
|
||
|
if (param.getName() == "future") {
|
||
|
if (date < QDate::currentDate()) {
|
||
|
ErrorMsg(param.getName(), "Date is not in the future.");
|
||
|
ErrorMsg(param.getName(), "<property> is not in the future.");
|
||
|
}
|
||
|
} else if (param.getName() == "past") {
|
||
|
if (date > QDate::currentDate()) {
|
||
|
ErrorMsg(param.getName(), "Date is not in the past.");
|
||
|
ErrorMsg(param.getName(), "<property> is not in the past.");
|
||
|
}
|
||
|
|
||
|
} else if (param.getName() == "min" && date < param.getValue().toDate()) {
|
||
|
ErrorMsg(param.getName(),
|
||
|
"Date must be no less than " + param.getValue().toString());
|
||
|
"<property> must be no less than " + param.getValue().toString());
|
||
|
} else if (param.getName() == "max" && date > param.getValue().toDate()) {
|
||
|
ErrorMsg(param.getName(),
|
||
|
"Date must be no greater than " + param.getValue().toString());
|
||
|
"<property> must be no greater than " + param.getValue().toString());
|
||
|
}
|
||
|
}
|
||
|
//cause we don't want to replace functionality of RequiredValidator
|
||
Auch abrufbar als: Unified diff
...