Check if it's the anniversary. Compares the date/month values of the two dates.
(self, dt: date | None = None)
| 164 | return self == dt |
| 165 | |
| 166 | def is_anniversary(self, dt: date | None = None) -> bool: |
| 167 | """ |
| 168 | Check if it's the anniversary. |
| 169 | |
| 170 | Compares the date/month values of the two dates. |
| 171 | """ |
| 172 | if dt is None: |
| 173 | dt = self.__class__.today() |
| 174 | |
| 175 | instance = self.__class__(dt.year, dt.month, dt.day) |
| 176 | |
| 177 | return (self.month, self.day) == (instance.month, instance.day) |
| 178 | |
| 179 | # the additional method for checking if today is the anniversary day |
| 180 | # the alias is provided to start using a new name and keep the backward |