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 Date-related parameter types #603

Closed
numbsafari opened this issue Jul 7, 2016 · 9 comments
Closed

Add Date-related parameter types #603

numbsafari opened this issue Jul 7, 2016 · 9 comments

Comments

@numbsafari
Copy link

I apologize if this is the wrong way to open this up, I went to the IRC channel and posted there but did not really get any response.

Many of the scripts I write have date options, e.g.:

$ my-app import-task --start-date=2015-01-01 --end-date=2016-01-01
$ my-app import-task --date=2015-01-01 --lookback=3days
$ my-app import-task --lookback=1week
  • Explicit dates/times.
  • timedeltas
  • Defaults settable to now/utcnow

I think this would be pretty trivial to add, focused strictly on the built-in datetime package. One could take advantage of other date parsing utility libraries, but that would add dependencies that might not be needed by others.

I'm willing to make a PR for this, just wanted to get a bit of feedback or a nod before submitting something from left field. Also, if you think simple "DateType" support would be better as a click-contrib package, and I'll go that route.

@ddaws
Copy link

ddaws commented Aug 17, 2016

I agree that this is a common use case. I am also willing to contribute, and am curious if the correct route is to submit a PR or create a click-contrib package.

@ddaws
Copy link

ddaws commented Aug 17, 2016

I have created a repo called click-datetime and have started working on supporting Datetime objects. @numbsafari I sent you an invite as a contributor to the repo.

@untitaker
Copy link
Contributor

I think a better path for now would be click-contrib. I can invite either of you as member such that you can create your own repos there (and transfer existing ones).

@ddaws
Copy link

ddaws commented Aug 24, 2016

@untitaker sounds good. I have created https://github.com/ddaws/click-datetime and will migrate to click-contrib when added.

@untitaker
Copy link
Contributor

Done

@ddaws
Copy link

ddaws commented Aug 25, 2016

@untitaker should this issue be closed because this functionality is now available via a contrib package?

@untitaker
Copy link
Contributor

Yes, thanks for the reminder.

@Jaza
Copy link

Jaza commented Aug 28, 2016

@ddaws - thanks for contributing click-datetime, was looking for exactly this (and I kinda expected it to be in Click core, but hey, dates / times can get complicated, so maybe it's better in a separate project), will give it a try now.

@ddaws
Copy link

ddaws commented Aug 29, 2016

@Jaza glad it's useful to you. It is very minimal so please let me know if there is any functionality you would like to see added :)

@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

No branches or pull requests

4 participants