spoguļota no
https://gitea.phreedom.club/localhost_frssoft/FMN_bot.git
sinhronizēta 2025-07-01 23:34:15 +00:00
some fix, well fucked up gregorian calendar...
Šis iesūtījums ir iekļauts:
vecāks
e696eaa375
iesūtījums
9b1fc812d4
2 izmainītas datnes ar 13 papildinājumiem un 5 izdzēšanām
|
@ -8,8 +8,16 @@ def check_stop_thread_scan(suggested_date):
|
|||
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))
|
||||
if tuesdays == []:
|
||||
shift_for_next_week = suggested_date + datetime.timedelta(days=1)
|
||||
suggested_month = shift_for_next_week.month
|
||||
suggested_year = shift_for_next_week.year
|
||||
for i in calendar.Calendar().itermonthdays4(suggested_year, suggested_month):
|
||||
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
|
||||
|
|
Notiek ielāde…
Pievienot tabulu
Pievienot saiti
Atsaukties jaunā pieteikumā