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

digits

The number of digits required for the input

mask

The format mask to be applied to the input

See also

Entries

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard
val digits: Int
Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

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.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.