MCPcopy Index your code
hub / github.com/python-pendulum/pendulum / is_anniversary

Method is_anniversary

src/pendulum/datetime.py:543–555  ·  view source on GitHub ↗

Check if its the anniversary. Compares the date/month values of the two dates.

(  # type: ignore[override]
        self, dt: datetime.datetime | None = None
    )

Source from the content-addressed store, hash-verified

541 return self.to_date_string() == dt.to_date_string()
542
543 def is_anniversary( # type: ignore[override]
544 self, dt: datetime.datetime | None = None
545 ) -> bool:
546 """
547 Check if its the anniversary.
548 Compares the date/month values of the two dates.
549 """
550 if dt is None:
551 dt = self.now(self.tz)
552
553 instance = self.instance(dt)
554
555 return (self.month, self.day) == (instance.month, instance.day)
556
557 # ADDITIONS AND SUBSTRACTIONS
558

Callers

nothing calls this directly

Calls 2

nowMethod · 0.95
instanceMethod · 0.95

Tested by

no test coverage detected