mirror of
https://github.com/jdejaegh/irm-kmi-ha.git
synced 2025-06-27 03:35:56 +02:00
8 lines
204 B
Python
8 lines
204 B
Python
from datetime import timedelta
|
|
|
|
|
|
def next_weekday(current, weekday):
|
|
days_ahead = weekday - current.weekday()
|
|
if days_ahead < 0:
|
|
days_ahead += 7
|
|
return current + timedelta(days_ahead)
|