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

Track (and return) input granularity #32

Open
MiniaczQ opened this issue Jul 24, 2024 · 0 comments
Open

Track (and return) input granularity #32

MiniaczQ opened this issue Jul 24, 2024 · 0 comments

Comments

@MiniaczQ
Copy link

I found this crate while looking for convenient human date(time) parser.
I wanted to use this for filtering in a time range from..to.

The thing that's crucial for that is deciding the granularity the user is working at.
Say I want to find everything from 2023, meaning I want everything from 2023.01.01 to 2023.12.31.

If we assume there is time involved, this becomes much more apparent.
Find everything from jan -> from 2024.01.01 00:00:00.000 to 2024.01.31 23:59:59.999
Same for jan 1 -> from 2024.01.01 (00:00:00.000) to 2024.01.01 (23:59:59.999)

With that said, what I'd like to access is the highest unit type used in the date: year, month, day (, hour, minute, second)
So that I can appropriately fill in all the fields below that granularity, with minimal or maximum values depending on the boundary it's for.

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

No branches or pull requests

1 participant