diff --git a/mealie/schema/_mealie/mealie_model.py b/mealie/schema/_mealie/mealie_model.py index d46ed11849f..62ff5d3d2ad 100644 --- a/mealie/schema/_mealie/mealie_model.py +++ b/mealie/schema/_mealie/mealie_model.py @@ -1,5 +1,6 @@ from __future__ import annotations +import re from collections.abc import Sequence from datetime import datetime, timezone from enum import Enum @@ -16,6 +17,8 @@ T = TypeVar("T", bound=BaseModel) +HOUR_ONLY_TZ_PATTERN = re.compile(r"[+-]\d{2}$") + class SearchType(Enum): fuzzy = "fuzzy" @@ -49,8 +52,7 @@ def fix_hour_only_tz(cls, data: T) -> T: continue except AttributeError: continue - # this only works for UTC, but we enforce UTC throughout the entire application - if val.endswith("+00"): + if re.search(HOUR_ONLY_TZ_PATTERN, val): setattr(data, field, val + ":00") return data