Development
This commit is contained in:
parent
9f81693334
commit
76c7d81466
4 changed files with 33 additions and 5 deletions
|
|
@ -94,6 +94,20 @@ def port(value):
|
|||
return ''
|
||||
|
||||
|
||||
# ===================================================================
|
||||
# Time
|
||||
# ===================================================================
|
||||
|
||||
def time_24h(value):
|
||||
"""Return value if it is a valid 24-hour HH:MM time string, else ''."""
|
||||
if not value:
|
||||
return ''
|
||||
v = str(value).strip()
|
||||
if re.fullmatch(r'([01]\d|2[0-3]):[0-5]\d', v):
|
||||
return v
|
||||
return ''
|
||||
|
||||
|
||||
# ===================================================================
|
||||
# Integer range
|
||||
# ===================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue