Modify the current instance to the average of a given instance (default now) and the current instance.
(self, dt: date | None = None)
| 715 | return self.set(self.year, dt.month, dt.day) |
| 716 | |
| 717 | def average(self, dt: date | None = None) -> Self: |
| 718 | """ |
| 719 | Modify the current instance to the average |
| 720 | of a given instance (default now) and the current instance. |
| 721 | """ |
| 722 | if dt is None: |
| 723 | dt = Date.today() |
| 724 | |
| 725 | return self.add(days=int(self.diff(dt, False).in_days() / 2)) |
| 726 | |
| 727 | # Native methods override |
| 728 |