module

TUI::Validation

Input validators for editable fields. Pure functions over strings — no widget state, no I/O.

Constants

TIME_FORMATS = ["%Y-%m-%d %H:%M:%S", "%Y-%m-%dT%H:%M:%S", "%Y-%m-%d %H:%M:%S.%L", "%Y-%m-%dT%H:%M:%S.%L", "%Y-%m-%d %H:%M:%S%z", "%Y-%m-%dT%H:%M:%S%z", "%Y-%m-%d %H:%M:%S.%L%z", "%Y-%m-%dT%H:%M:%S.%L%z", "%Y-%m-%d"]

Accepted time formats — ISO 8601 variants with optional T-separator, fractional seconds, and timezone offset, plus bare date.

Class methods

valid_decimal?(s : String) : Bool

True if the input parses as an arbitrary-precision decimal.

Source
valid_float?(s : String) : Bool

True if the input parses as a 64-bit binary float.

Source
valid_int?(s : String) : Bool

True if the input parses as a 64-bit signed integer.

Source
valid_time?(s : String) : Bool

True if the input parses successfully under any accepted format.

Source