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

Method farthest

src/pendulum/date.py:122–132  ·  view source on GitHub ↗

Get the farthest date from the instance.

(self, dt1: date, dt2: date)

Source from the content-addressed store, hash-verified

120 return dt2
121
122 def farthest(self, dt1: date, dt2: date) -> Self:
123 """
124 Get the farthest date from the instance.
125 """
126 dt1 = self.__class__(dt1.year, dt1.month, dt1.day)
127 dt2 = self.__class__(dt2.year, dt2.month, dt2.day)
128
129 if self.diff(dt1).in_seconds() > self.diff(dt2).in_seconds():
130 return dt1
131
132 return dt2
133
134 def is_future(self) -> bool:
135 """

Callers 3

test_farthestFunction · 0.95
test_farthest_with_dateFunction · 0.95

Calls 2

diffMethod · 0.95
in_secondsMethod · 0.80

Tested by 3

test_farthestFunction · 0.76
test_farthest_with_dateFunction · 0.76