ExpirationDateFormat
Represents different formats for card expiration date input. This enum defines the supported formats for entering card expiration dates, including both short (MM/YY) and long (MM/YYYY) formats. It provides the necessary input length and mask for each format type.
The enum is used to configure the expiration date input field's behavior, ensuring consistent formatting and validation across the payment form.
Example:
// Use short format (MM/YY)
val shortFormat = ExpirationDateFormat.ShortFormat
val shortMask = shortFormat.mask // "##/##"
val shortDigits = shortFormat.digits // 4
// Use long format (MM/YYYY)
val longFormat = ExpirationDateFormat.LongFormat
val longMask = longFormat.mask // "##/####"
val longDigits = longFormat.digits // 6
// Apply format to input field
ExpirationDateTextField(
state = state,
onEvent = { /* handle events */},
dateFormat = ExpirationDateFormat.ShortFormat
)
Parameters
The number of digits required for the input
The format mask to be applied to the input
See also
Entries
Represents the short format for expiration dates (MM/YY). This format requires 4 digits (2 for month, 2 for year) and displays them in the format MM/YY.
Represents the long format for expiration dates (MM/YYYY). This format requires 6 digits (2 for month, 4 for year) and displays them in the format MM/YYYY.
Properties
Functions
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Returns an array containing the constants of this enum type, in the order they're declared.