Add months timeframe for newsletters

* Closes #1876
This commit is contained in:
JonnyWong16 2022-11-07 11:26:13 -08:00
parent b74a1a3c32
commit a3ad40122d
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 5 additions and 2 deletions

View file

@ -402,7 +402,9 @@ class Newsletter(object):
pass
if self.start_date is None:
if self.config['time_frame_units'] == 'days':
if self.config['time_frame_units'] == 'months':
self.start_date = self.end_date.shift(months=-self.config['time_frame'])
elif self.config['time_frame_units'] == 'days':
self.start_date = self.end_date.shift(days=-self.config['time_frame'])
else:
self.start_date = self.end_date.shift(hours=-self.config['time_frame'])