module
TUI::Validation
Overview
Input validators for editable fields. Pure functions over strings — no widget state, no I/O.
Defined in:
tui/validation.crConstant Summary
-
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 Method Summary
-
.valid_decimal?(s : String) : Bool
True if the input parses as an arbitrary-precision decimal.
-
.valid_float?(s : String) : Bool
True if the input parses as a 64-bit binary float.
-
.valid_int?(s : String) : Bool
True if the input parses as a 64-bit signed integer.
-
.valid_time?(s : String) : Bool
True if the input parses successfully under any accepted format.
Class Method Detail
def self.valid_decimal?(s : String) : Bool
#
True if the input parses as an arbitrary-precision decimal.
def self.valid_time?(s : String) : Bool
#
True if the input parses successfully under any accepted format.