Attempt to work around timezones
This commit is contained in:
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user