Adjust the number of times an annual offset is applied based on another date, and the reference day provided
(other, n, month, reference_day)
| 274 | |
| 275 | |
| 276 | def _adjust_n_years(other, n, month, reference_day): |
| 277 | """Adjust the number of times an annual offset is applied based on |
| 278 | another date, and the reference day provided""" |
| 279 | if n > 0: |
| 280 | if other.month < month or (other.month == month and other.day < reference_day): |
| 281 | n -= 1 |
| 282 | elif other.month > month or (other.month == month and other.day > reference_day): |
| 283 | n += 1 |
| 284 | return n |
| 285 | |
| 286 | |
| 287 | def _shift_month(date, months, day_option: DayOption = "start"): |
no outgoing calls
no test coverage detected
searching dependent graphs…