Date and/or time validator checking if attribute date/time/datetime and in specified range.
You can find more information in comments below. Overrided methods can be found in corresponding base class or interface.
class CDbValidatorDateTime :public CDbValidator
{
public:
enum class Type // Comparison type
{
Date, // As date only
Time, // As time only
DateTime // Both date and time
};
public:
// IDbValidator methods
bool Validate(CDbModel *model, IDbAttribute *attribute, String &error) override;
CDbValidatorDateTime();
CDbValidatorDateTime *setStrict(const bool &value); // Set whether strict comparison (type check) is required
CDbValidatorDateTime *setType(const Type &value); // Set comparison type
CDbValidatorDateTime *setFormat(const String &value); // Set format to convert from string to datetime
CDbValidatorDateTime *setMin(const DbDateTime &value); // Set minimum value
CDbValidatorDateTime *setMax(const DbDateTime &value); // Set maximum value
CDbValidatorDateTime *setTooBig(const String &value); // Set error message indicating a value is too big (greater than maximum value)
CDbValidatorDateTime *setTooSmall(const String &value); // Set error message indicating a value is too small (less than minimum value)
static ReleasablePtr<CDbValidatorDateTime> Create(); // Helper static method to create validator in form used in model rule adding methods
};
Namespace: | nitisa |
Include: | Nitisa/Db/DbValidatorDateTime.h |