@@ -903,9 +903,13 @@ cpdef int get_day_of_month(datetime other, day_opt) except? -1:
903
903
Parameters
904
904
----------
905
905
other : datetime or Timestamp
906
- day_opt : 'start', 'end'
906
+ day_opt : 'start', 'end', 'business_start', 'business_end', or int
907
907
'start': returns 1
908
908
'end': returns last day of the month
909
+ 'business_start': returns the first business day of the month
910
+ 'business_end': returns the last business day of the month
911
+ int: returns the day in the month indicated by `other`, or the last of
912
+ day the month if the value exceeds in that month's number of days.
909
913
910
914
Returns
911
915
-------
@@ -980,14 +984,18 @@ def roll_qtrday(other: datetime, n: int, month: int,
980
984
other : datetime or Timestamp
981
985
n : number of periods to increment , before adjusting for rolling
982
986
month : int reference month giving the first month of the year
983
- day_opt : 'start', 'end', 'business_start', 'business_end'
987
+ day_opt : 'start', 'end', 'business_start', 'business_end', or int
984
988
The convention to use in finding the day in a given month against
985
989
which to compare for rollforward/rollbackward decisions.
986
990
modby : int 3 for quarters , 12 for years
987
991
988
992
Returns
989
993
-------
990
994
n : int number of periods to increment
995
+
996
+ See Also
997
+ --------
998
+ get_day_of_month : Find the day in a month provided an offset.
991
999
"""
992
1000
cdef:
993
1001
int months_since
@@ -1022,9 +1030,16 @@ def roll_yearday(other: datetime, n: int, month: int, day_opt: object) -> int:
1022
1030
other : datetime or Timestamp
1023
1031
n : number of periods to increment , before adjusting for rolling
1024
1032
month : reference month giving the first month of the year
1025
- day_opt : 'start', 'end'
1026
- 'start': returns 1
1027
- 'end': returns last day of the month
1033
+ day_opt : 'start', 'end', 'business_start', 'business_end', or int
1034
+ The day of the month to compare against that of `other` when
1035
+ incrementing or decrementing the number of periods:
1036
+
1037
+ 'start': 1
1038
+ 'end': last day of the month
1039
+ 'business_start': first business day of the month
1040
+ 'business_end': last business day of the month
1041
+ int: day in the month indicated by `other`, or the last of day
1042
+ the month if the value exceeds in that month's number of days.
1028
1043
1029
1044
Returns
1030
1045
-------
0 commit comments