mirror of
https://gitea.phreedom.club/localhost_frssoft/FMN_bot.git
synced 2025-03-15 02:50:34 +00:00
16 lines
570 B
Python
16 lines
570 B
Python
|
import calendar
|
||
|
import datetime
|
||
|
from config import hour_poll_posting
|
||
|
|
||
|
|
||
|
def check_stop_thread_scan(suggested_date):
|
||
|
suggested_month = suggested_date.month
|
||
|
suggested_year = suggested_date.year
|
||
|
tuesdays = []
|
||
|
for i in calendar.Calendar().itermonthdays4(suggested_year, suggested_month):
|
||
|
print(i)
|
||
|
if i[3] == 1 and datetime.datetime(year=i[0], month=i[1], day=i[2]) > suggested_date:
|
||
|
tuesdays.append(datetime.datetime(
|
||
|
year=i[0], month=i[1], day=i[2], hour=hour_poll_posting))
|
||
|
return tuesdays[0] # near tuesday
|