phase-6: alerts engine, scheduler, notifications, calibration popup, and dashboard

This commit is contained in:
Atharv1705
2026-11-12 14:39:22 +05:30
parent ba4777b182
commit aec1b6ad41
25 changed files with 2743 additions and 58 deletions
+11
View File
@@ -40,6 +40,17 @@ def effective_today(db=None) -> date:
return datetime.now(KOLKATA).date()
def effective_now_utc(db=None) -> datetime:
"""Returns current UTC datetime anchored to effective_today(db) in Asia/Kolkata when demo date is set."""
now_kol = datetime.now(KOLKATA)
today = effective_today(db)
if today == now_kol.date():
return now_kol.astimezone(timezone.utc)
return KOLKATA.localize(datetime.combine(today, now_kol.timetz().replace(tzinfo=None))).astimezone(
timezone.utc
)
def to_kolkata(dt: datetime) -> datetime:
return dt.astimezone(KOLKATA)