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 relative date parsing in args #1186

Closed
remyleone opened this issue Jul 7, 2020 · 1 comment · Fixed by #1366
Closed

Add support for relative date parsing in args #1186

remyleone opened this issue Jul 7, 2020 · 1 comment · Fixed by #1366

Comments

@remyleone
Copy link
Member

remyleone commented Jul 7, 2020

Description

When we use date we want to be able to parse it like "-3d" or "+3d" relative to the current date.

How this functionality would be exposed

I should be able to fill a date argument using either an absolut dateime or a relative one

scw ... from=2020-07-08T12:00:00Z  <= ISO 8601 /  RFC 3339
scw ... from=+3d <= 3 day in the future
scw ... from=3d <= 3 day in the future
scw ... from=-3d <= 3 day in the past

We should at least handle d, h, m, s

As relative time will probably cause problems with golden we should consider adding (if needed) a core.ExtractNow(ctx) that can guarantee constant result in tests

References

Version

Version 2.0.0-beta.4+dev
BuildDate unknown
GoVersion go1.14.4
GitBranch unknown
GitCommit unknown
GoArch amd64
GoOS darwin

@jerome-quere jerome-quere added this to the v2.1.0 milestone Jul 10, 2020
@jerome-quere jerome-quere changed the title add support for relative date parsing Add support for relative date parsing in args Jul 22, 2020
@remyleone remyleone linked a pull request Aug 31, 2020 that will close this issue
@remyleone
Copy link
Member Author

@jerome-quere The problem with adding a core.ExtractNow is that it will create an import loop because the core package already import args.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants