File tree 2 files changed +8
-3
lines changed
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:
1468
1468
:header: "Rule", "Description"
1469
1469
:widths: 15, 70
1470
1470
1471
+ "next_workday", "move Saturday and Sunday to Monday"
1472
+ "previous_workday", "move Saturday and Sunday to Friday"
1471
1473
"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"
1472
1476
"sunday_to_monday", "move Sunday to following Monday"
1473
1477
"next_monday_or_tuesday", "move Saturday to Monday and Sunday/Monday to Tuesday"
1474
1478
"previous_friday", move Saturday and Sunday to previous Friday"
1475
1479
"next_monday", "move Saturday and Sunday to following Monday"
1480
+ "weekend_to_monday", "same as ``next_monday ``"
1476
1481
1477
1482
An example of how holidays and holiday calendars are defined:
1478
1483
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ def nearest_workday(dt: datetime) -> datetime:
108
108
109
109
def next_workday (dt : datetime ) -> datetime :
110
110
"""
111
- returns next weekday used for observances
111
+ returns next workday used for observances
112
112
"""
113
113
dt += timedelta (days = 1 )
114
114
while dt .weekday () > 4 :
@@ -119,7 +119,7 @@ def next_workday(dt: datetime) -> datetime:
119
119
120
120
def previous_workday (dt : datetime ) -> datetime :
121
121
"""
122
- returns previous weekday used for observances
122
+ returns previous workday used for observances
123
123
"""
124
124
dt -= timedelta (days = 1 )
125
125
while dt .weekday () > 4 :
@@ -130,7 +130,7 @@ def previous_workday(dt: datetime) -> datetime:
130
130
131
131
def before_nearest_workday (dt : datetime ) -> datetime :
132
132
"""
133
- returns previous workday after nearest workday
133
+ returns previous workday before nearest workday
134
134
"""
135
135
return previous_workday (nearest_workday (dt ))
136
136
You can’t perform that action at this time.
0 commit comments