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 datetime/date/time types #44

Closed
wants to merge 2 commits into from
Closed

add datetime/date/time types #44

wants to merge 2 commits into from

Conversation

thbourlove
Copy link

I implemented three custom types that I think maybe useful for someone else.

@mitsuhiko
Copy link
Contributor

The main problem with this is that there are so many different import formats for dates and times and this is just one of many. :( Not sure yet.

@thbourlove
Copy link
Author

I think maybe we do not need to cover so many different formats. But just some common format, like 2014-04-30 16:22:25, 20140430162225 or 2014.04.30 etc.

@mitsuhiko
Copy link
Contributor

but what about 24-12-2014?

@thbourlove
Copy link
Author

How about use common format in default, but if you want a custom format of date. you can do this in your code:

@click.option('--start', '-s', type=click.DateParamType('%d-%m-%Y'))

@thbourlove
Copy link
Author

or just like this:
@click.option('--start', '-s', type=click.DATE('%d-%m-%Y'))

@mitsuhiko
Copy link
Contributor

I'm not convinced yet that this is a good idea. Try to convince me :)

@mitsuhiko
Copy link
Contributor

Closing it for the time being.

@mitsuhiko mitsuhiko closed this May 2, 2014
@enricobarzetti enricobarzetti mentioned this pull request Aug 20, 2020
6 tasks
@pallets pallets locked as resolved and limited conversation to collaborators Aug 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants