chore: added a docstring for the get_next_schedule_date method

This commit is contained in:
Rucha Mahabal 2020-12-16 12:09:10 +05:30
parent 4c1756b3d6
commit 7d70e552aa

View file

@ -219,6 +219,13 @@ class AutoRepeat(Document):
new_doc.set('to_date', to_date)
def get_next_schedule_date(self, schedule_date, for_full_schedule=False):
"""
Returns the next schedule date for auto repeat after a recurring document has been created.
Adds required offset to the schedule_date param and returns the next schedule date.
:param schedule_date: The date when the last recurring document was created.
:param for_full_schedule: If True, returns the immediate next schedule date, else the full schedule.
"""
if month_map.get(self.frequency):
month_count = month_map.get(self.frequency) + month_diff(schedule_date, self.start_date) - 1
else: