fixed metadata time import error and moved quest status widget to top of settings.
This commit is contained in:
@@ -301,6 +301,18 @@ def resolve_date_conflict(existing_date: Optional[datetime], new_date: Optional[
|
||||
if new_date is None:
|
||||
return existing_date
|
||||
|
||||
# Normalize timezone awareness before comparison
|
||||
# If one is aware and one is naive, strip timezone from the aware one
|
||||
existing_aware = existing_date.tzinfo is not None
|
||||
new_aware = new_date.tzinfo is not None
|
||||
|
||||
if existing_aware and not new_aware:
|
||||
# Strip timezone from existing to compare
|
||||
existing_date = existing_date.replace(tzinfo=None)
|
||||
elif new_aware and not existing_aware:
|
||||
# Strip timezone from new to compare
|
||||
new_date = new_date.replace(tzinfo=None)
|
||||
|
||||
# Return the earlier date
|
||||
return min(existing_date, new_date)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user