From 40b89566524a06fe1fe6215c23b63829aec56975 Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Sat, 16 Dec 2023 22:42:46 +0530 Subject: [PATCH] docs: add_days, add_months, add_years --- frappe/utils/data.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frappe/utils/data.py b/frappe/utils/data.py index 0177293ef3..0df5a32ef5 100644 --- a/frappe/utils/data.py +++ b/frappe/utils/data.py @@ -275,15 +275,18 @@ def add_to_date( return date -def add_days(date, days): +def add_days(date: DateTimeLikeObject, days: NumericType) -> DateTimeLikeObject: + """Returns a new date after adding the given number of `days` to the given `date`.""" return add_to_date(date, days=days) -def add_months(date, months): +def add_months(date: DateTimeLikeObject, months: NumericType) -> DateTimeLikeObject: + """Returns a new date after adding the given number of `months` to the given `date`.""" return add_to_date(date, months=months) -def add_years(date, years): +def add_years(date: DateTimeLikeObject, years: NumericType) -> DateTimeLikeObject: + """Returns a new date after adding the given number of `years` to the given `date`.""" return add_to_date(date, years=years)