VgsMinMaxDateValidator

class VgsMinMaxDateValidator(minDate: Long, maxDate: Long, val dateFormat: VgsExpiryDateFormat, val errorMsg: String = ERROR_MESSAGE) : VgsTextFieldValidator

Validator that requires the parsed date to fall within an inclusive range.

Useful for card expiry fields to reject dates in the past or far in the future.

Parameters

minDate

earliest accepted date as a Unix timestamp in milliseconds.

maxDate

latest accepted date as a Unix timestamp in milliseconds.

dateFormat

the format used to parse the field's text.

errorMsg

message returned when the date is outside the range or unparsable.

Constructors

Link copied to clipboard
constructor(minDate: Long, maxDate: Long, dateFormat: VgsExpiryDateFormat, errorMsg: String = ERROR_MESSAGE)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class Result(val isValid: Boolean, val errorMsg: String? = null) : VgsTextFieldValidationResult

Properties

Link copied to clipboard
Link copied to clipboard
open override val errorMsg: String
Link copied to clipboard