Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for datetime,date,time converters #1398

Conversation

Mng-dev-ai
Copy link
Contributor

@Mng-dev-ai Mng-dev-ai commented Jan 7, 2022

These converters are useful when we want to capture a URL that contains a Date,Date-time or Time.
e.g. /users/created_at/2020-01-01

@Kludex
Copy link
Member

Kludex commented Jan 7, 2022

More information is needed.

@aminalaee
Copy link
Member

aminalaee commented Jan 8, 2022

I think it's a bit tricky as these types could have different formattings. What do you think?

Maybe a generic RegexConverter would cover all these.

@Mng-dev-ai
Copy link
Contributor Author

@aminalaee You're right but I think it would be better if the both are supported because regex maybe hard for some people to use.

@Kludex Kludex mentioned this pull request Jan 27, 2022
1 task
@Kludex
Copy link
Member

Kludex commented Jan 27, 2022

@Mng-dev-ai Thanks for the PR!

I don't think this is the right path to follow on Starlette, but I do think you should be able to create custom converters. I'm going to work on the "register custom converters" PR (follow #1437).

That being said, I'm going to close this PR.

@Kludex Kludex closed this Jan 27, 2022
@Mng-dev-ai Mng-dev-ai deleted the add-support-for-dateime,date,time-converters branch January 27, 2022 09:27
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.

3 participants