Fix absolute timestring handler date sensitivity

This commit is contained in:
digimint 2025-11-21 17:43:34 -06:00
parent 9edce9160e
commit 09a2eb412b
Signed by: digimint
GPG key ID: 8DF1C6FD85ABF748

View file

@ -516,6 +516,11 @@ def from_sophont_provided_data(data: str, user_tz: str = 'Etc/UTC') -> Either[Ex
>>> from_sophont_provided_data('2026-01-01', 'America/Chicago')
Right[datetime](datetime(2026, 01, 02, 05, 59, 59, tzinfo=timezone.utc))
'''
data = re.sub(
'\\s+',
' ',
data # ensure any whitespace is reduced to single spaces
).upper().strip().replace(',', '')
try:
tz = ZoneInfo(user_tz)