-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Zdeněk Balák
committed
May 2, 2019
1 parent
1d2c929
commit 4009c95
Showing
8 changed files
with
104 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...ibrary/src/main/java/cz/qase/android/formbuilderlibrary/validator/NotInFutureValidator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package cz.qase.android.formbuilderlibrary.validator | ||
|
||
import cz.qase.android.formbuilderlibrary.ValidationException | ||
import org.joda.time.DateTime | ||
|
||
/** | ||
* MaxLengthFormValidator | ||
* | ||
* Check if length of form value is bigger than specified value | ||
*/ | ||
class NotInFutureValidator( | ||
private val errorMsg: String | ||
) : FormValidator<DateTime> { | ||
override fun validate(value: DateTime?) { | ||
if (value != null && value.isAfterNow) { | ||
throw ValidationException(errorMsg) | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...rlibrary/src/main/java/cz/qase/android/formbuilderlibrary/validator/NotInPastValidator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package cz.qase.android.formbuilderlibrary.validator | ||
|
||
import cz.qase.android.formbuilderlibrary.ValidationException | ||
import org.joda.time.DateTime | ||
|
||
/** | ||
* MaxLengthFormValidator | ||
* | ||
* Check if length of form value is bigger than specified value | ||
*/ | ||
class NotInPastValidator( | ||
private val errorMsg: String | ||
) : FormValidator<DateTime> { | ||
override fun validate(value: DateTime?) { | ||
if (value != null && value.isBeforeNow) { | ||
throw ValidationException(errorMsg) | ||
} | ||
} | ||
} |