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

allow more flexible date handling #30

Merged
merged 4 commits into from
Apr 10, 2024

Conversation

itcarroll
Copy link
Member

Closes #29

The temporal filter accepts objects with a strftime method (e.g Python's standard library date and datetime objects) or "ISO-8601 strings", but it doesn't accept all ISO-8601 strings and it doesn't handle non utc datetime objects.

This PR offers an enhancement that accepts ISO-8601 strings with reduced precision. A user can supply a year (e.g. party like it's "1999") or a month (e.g. "1963-12" ... what a night) and get a valid interpretation. As part of this implementation, the temporal filter knows to round-down the "date-from" and round-up the "date-to".

This PR also offers the enhancement of accepting strings or datetime objects that specify a timezone, and converts them to UTC for the CMR API.

The first commit is just a bit of housekeeping (poetry indicated the poetry.lock file was out of sync with pyproject.toml).

@itcarroll itcarroll marked this pull request as ready for review April 3, 2024 16:13
@frankinspace frankinspace self-requested a review April 10, 2024 16:08
@frankinspace
Copy link
Collaborator

Thank you @itcarroll . For the future, please add an entry to the 'Unreleased' section of the CHANGELOG when submitting pull requests. Great work!

@frankinspace frankinspace merged commit d88120b into nasa:develop Apr 10, 2024
1 check passed
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.

improve ISO 8601 parsing for temporal filter
2 participants