Adjust the number of times a monthly offset is applied based on the day of a given date, and the reference day provided.
(other_day, n, reference_day)
| 263 | |
| 264 | |
| 265 | def _adjust_n_months(other_day, n, reference_day): |
| 266 | """Adjust the number of times a monthly offset is applied based |
| 267 | on the day of a given date, and the reference day provided. |
| 268 | """ |
| 269 | if n > 0 and other_day < reference_day: |
| 270 | n = n - 1 |
| 271 | elif n <= 0 and other_day > reference_day: |
| 272 | n = n + 1 |
| 273 | return n |
| 274 | |
| 275 | |
| 276 | def _adjust_n_years(other, n, month, reference_day): |