Closed YuevUwU closed 3 months ago
The recent changes enhance the date comparison logic in the charge
method of the ChargeHandler
class. By employing the timedelta
class, we ensure that daily charge calculations are accurate and not affected by time components in datetime
objects. This adjustment improves clarity and correctness in the control flow, making the functionality more robust.
File | Change Summary |
---|---|
cog/daily_charge.py |
Updated date comparison for combo using timedelta to improve accuracy and included timedelta in imports. |
In the land of code we strive,
Where dates and times come alive.
A tweak here, a change so bright,
Makes daily charges work just right!
Withtimedelta
in our paws,
We pounce on bugs, and give applause! 🎉🐾
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This PR fixes the expiration judgment of daily charge Test case results: https://gist.github.com/YuevUwU/7c99eca990fccb052dd6281687fcb356
Now
Charging failed after 48 hours.
Expected
Charging failed at 00:00 two days later.
Summary by CodeRabbit
timedelta
class for more precise date handling.