Replace datetime.datetime with DateTime across codebase (#1285)

* #1277  Replace datetime.datetime with DateTime across codebase

Replaced all instances of standard library 'datetime.datetime' with a new 'DateTime' type from `.custom` module. This change is necessary to make all date-time values compatible with the Telegram Bot API (it uses Unix time). This will simplify the conversion process and eliminate potential errors related to date-time format mismatches. Changed codebase, butcher files, and modified 'pyproject.toml' to shift the typing-extensions dependency. The 'aiogram/custom_types.py' file was renamed to 'aiogram/types/custom.py' to better reflect its nature as a location for custom types used in the aiogram library.
This commit is contained in:
Alex Root Junior 2023-08-27 17:09:56 +03:00 committed by GitHub
parent 397f30b58b
commit 6eb5ef2606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 65 additions and 43 deletions

View file

@ -45,6 +45,7 @@ dependencies = [
"pydantic>=2.1.1,<3",
"aiofiles~=23.1.0",
"certifi>=2023.7.22",
"typing-extensions~=4.7.1",
]
dynamic = ["version"]
@ -102,7 +103,6 @@ dev = [
"pre-commit~=3.3.3",
"towncrier~=23.6.0",
"packaging~=23.0",
"typing-extensions~=4.7.1",
]
[project.urls]