diff --git a/formbuilderlibrary/src/main/java/cz/qase/android/formbuilderlibrary/validator/DateTimeNotNullValidator.kt b/formbuilderlibrary/src/main/java/cz/qase/android/formbuilderlibrary/validator/DateTimeNotNullValidator.kt new file mode 100644 index 0000000..ab22225 --- /dev/null +++ b/formbuilderlibrary/src/main/java/cz/qase/android/formbuilderlibrary/validator/DateTimeNotNullValidator.kt @@ -0,0 +1,12 @@ +package cz.qase.android.formbuilderlibrary.validator + +import cz.qase.android.formbuilderlibrary.ValidationException +import org.joda.time.DateTime + +class DateTimeNotNullValidator(private val errorMsg: String) : FormValidator { + override fun validate(value: DateTime?) { + if (value == null) { + throw ValidationException(errorMsg) + } + } +}