File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -601,7 +601,7 @@ def offset(self):
601601
602602 @property
603603 def offset_hours (self ):
604- return int (self .get_offset ()
604+ return (self .get_offset ()
605605 / self .SECONDS_PER_MINUTE
606606 / self .MINUTES_PER_HOUR )
607607
@@ -1281,23 +1281,23 @@ def is_yesterday(self):
12811281
12821282 :rtype: bool
12831283 """
1284- return self .to_date_string () == self .yesterday (self .timezone ).to_date_string ()
1284+ return self .to_date_string () == self .yesterday (self ._tz ).to_date_string ()
12851285
12861286 def is_today (self ):
12871287 """
12881288 Determines if the instance is today.
12891289
12901290 :rtype: bool
12911291 """
1292- return self .to_date_string () == self .now (self .timezone ).to_date_string ()
1292+ return self .to_date_string () == self .now (self ._tz ).to_date_string ()
12931293
12941294 def is_tomorrow (self ):
12951295 """
12961296 Determines if the instance is tomorrow.
12971297
12981298 :rtype: bool
12991299 """
1300- return self .to_date_string () == self .tomorrow (self .timezone ).to_date_string ()
1300+ return self .to_date_string () == self .tomorrow (self ._tz ).to_date_string ()
13011301
13021302 def is_future (self ):
13031303 """
@@ -1410,7 +1410,9 @@ def is_birthday(self, dt=None):
14101410 if dt is None :
14111411 dt = Pendulum .now (self .timezone )
14121412
1413- return self .format ('%m%d' ) == self ._get_datetime (dt , True ).format ('%m%d' )
1413+ instance = self ._get_datetime (dt , True )
1414+
1415+ return (self .month , self .day ) == (instance .month , instance .day )
14141416
14151417 # ADDITIONS AND SUBSTRACTIONS
14161418
Original file line number Diff line number Diff line change @@ -332,6 +332,7 @@ def test_max_with_instance(self):
332332 def test_is_birthday (self ):
333333 d = Pendulum .now ()
334334 a_birthday = d .subtract (years = 1 )
335+ print (d , a_birthday )
335336 self .assertTrue (a_birthday .is_birthday ())
336337 not_a_birthday = d .subtract (days = 1 )
337338 self .assertFalse (not_a_birthday .is_birthday ())
Original file line number Diff line number Diff line change @@ -171,6 +171,7 @@ def test_is_today(self):
171171
172172 def test_is_yesterday (self ):
173173 d = Pendulum .now ()
174+ print (d , d .tomorrow (d .timezone ))
174175 self .assertFalse (d .is_yesterday ())
175176 d = d .subtract (days = 1 )
176177 self .assertTrue (d .is_yesterday ())
You can’t perform that action at this time.
0 commit comments