Skip to content

Fix expiration date comparison to use date-only logic#76

Merged
valITino merged 1 commit intomainfrom
claude/setup-blhackbox-YCeFZ
Mar 16, 2026
Merged

Fix expiration date comparison to use date-only logic#76
valITino merged 1 commit intomainfrom
claude/setup-blhackbox-YCeFZ

Conversation

@valITino
Copy link
Copy Markdown
Owner

Summary

Fixed a bug in the expiration date validation logic where datetime objects with timezone information were being compared to date objects, which could cause unexpected behavior or errors.

Key Changes

  • Changed exp_date from a timezone-aware datetime object to a date object by calling .date() on the parsed datetime
  • Changed datetime.now(UTC) to datetime.now(UTC).date() to ensure we're comparing date-to-date instead of datetime-to-date
  • This simplifies the comparison logic since expiration dates are specified as YYYY-MM-DD without time components

Implementation Details

The fix ensures that expiration date comparisons are performed at the date level rather than mixing datetime and date types. Since the EXPIRATION_DATE format only includes the date (YYYY-MM-DD), comparing against today's date is more semantically correct and avoids potential timezone-related edge cases.

https://claude.ai/code/session_01EEAgU9vmCAvuVvm6Y2grTq

…tion day

The check compared a midnight-only datetime against the current time, so any
EXPIRATION_DATE set to today would be considered expired after midnight UTC.
Now compares dates only, so authorization is valid through the end of the day.

https://claude.ai/code/session_01EEAgU9vmCAvuVvm6Y2grTq
@valITino valITino marked this pull request as ready for review March 16, 2026 10:12
@valITino valITino merged commit 4581fba into main Mar 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants