File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1468,11 +1468,16 @@ or some other non-observed day. Defined observance rules are:
14681468 :header: "Rule", "Description"
14691469 :widths: 15, 70
14701470
1471+ "next_workday", "move Saturday and Sunday to Monday"
1472+ "previous_workday", "move Saturday and Sunday to Friday"
14711473 "nearest_workday", "move Saturday to Friday and Sunday to Monday"
1474+ "before_nearest_workday", "apply ``nearest_workday `` and then move to previous workday before that day"
1475+ "after_nearest_workday", "apply ``nearest_workday `` and then move to next workday after that day"
14721476 "sunday_to_monday", "move Sunday to following Monday"
14731477 "next_monday_or_tuesday", "move Saturday to Monday and Sunday/Monday to Tuesday"
14741478 "previous_friday", move Saturday and Sunday to previous Friday"
14751479 "next_monday", "move Saturday and Sunday to following Monday"
1480+ "weekend_to_monday", "same as ``next_monday ``"
14761481
14771482An example of how holidays and holiday calendars are defined:
14781483
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ def nearest_workday(dt: datetime) -> datetime:
108108
109109def next_workday (dt : datetime ) -> datetime :
110110 """
111- returns next weekday used for observances
111+ returns next workday used for observances
112112 """
113113 dt += timedelta (days = 1 )
114114 while dt .weekday () > 4 :
@@ -119,7 +119,7 @@ def next_workday(dt: datetime) -> datetime:
119119
120120def previous_workday (dt : datetime ) -> datetime :
121121 """
122- returns previous weekday used for observances
122+ returns previous workday used for observances
123123 """
124124 dt -= timedelta (days = 1 )
125125 while dt .weekday () > 4 :
@@ -130,7 +130,7 @@ def previous_workday(dt: datetime) -> datetime:
130130
131131def before_nearest_workday (dt : datetime ) -> datetime :
132132 """
133- returns previous workday after nearest workday
133+ returns previous workday before nearest workday
134134 """
135135 return previous_workday (nearest_workday (dt ))
136136
You can’t perform that action at this time.
0 commit comments