Attempt to work around timezones

This commit is contained in:
2023-09-24 23:47:09 +02:00
parent b0f76f4c49
commit 3fa2f5a800
13 changed files with 99 additions and 36 deletions

View File

@@ -2,7 +2,6 @@ from datetime import datetime, timedelta, timezone
from pyrogram import filters
from pyrogram.types import Message
from pytz import timezone as pytz_timezone
from classes.garbage_entry import GarbageEntry
from classes.pyroclient import PyroClient
@@ -18,19 +17,15 @@ async def command_upcoming(app: PyroClient, message: Message):
if user.location is None:
await message.reply_text(
app._("upcoming_empty_location", "messages", locale=user.locale)
app._("location_empty", "messages", locale=user.locale)
)
return
date_min = (
datetime.now(pytz_timezone(user.location.timezone)).replace(
second=0, microsecond=0
)
datetime.now(user.location.timezone).replace(second=0, microsecond=0)
).replace(tzinfo=timezone.utc)
date_max = (
datetime.now(pytz_timezone(user.location.timezone)).replace(
second=0, microsecond=0
)
datetime.now(user.location.timezone).replace(second=0, microsecond=0)
+ timedelta(days=30)
).replace(tzinfo=timezone.utc)