Skip to content

Commit

Permalink
Merge pull request #163 from seriaati/master
Browse files Browse the repository at this point in the history
Fix missed_rewards property in DailyRewardInfo model
  • Loading branch information
seriaati authored Mar 12, 2024
2 parents 26dc4a5 + e50fc4c commit be18224
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions genshin/models/genshin/daily.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Daily reward models."""

import calendar
import datetime
import typing

Expand All @@ -19,8 +18,7 @@ class DailyRewardInfo(typing.NamedTuple):
def missed_rewards(self) -> int:
cn_timezone = datetime.timezone(datetime.timedelta(hours=8))
now = datetime.datetime.now(cn_timezone)
month_days = calendar.monthrange(now.year, now.month)[1]
return month_days - self.claimed_rewards
return now.day - self.claimed_rewards


class DailyReward(APIModel):
Expand Down

0 comments on commit be18224

Please sign in to comment.