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

Parse date locale strings, autocomplete filtering for date/datetime columns #1280

Closed
wants to merge 4 commits into from

Conversation

sc1f
Copy link
Contributor

@sc1f sc1f commented Jan 7, 2021

This PR takes over from #1274, and tries to fix some of the issues in #1242. Datetime filters are currently heavily format dependent - though the formats are the same as the date string formats supported by Perspective, this is not well-documented, and more specifically locale strings are not accepted in either the dataset nor the filters, but dates/datetimes are displayed as locale strings. This leads to a disconnect in the user experience, as the most obvious date format—the one displayed on the grid—is considered "invalid".

This PR adds in parsing support for US and UK locale strings, as well as enables autocomplete on date/datetime columns, which will display a list of the unique dates/datetimes as locale strings in the filter column. This should improve the user experience of datetime filters.

One unique issue right now pertains to strptime in the C STL - when given the US locale string format ("%m/%d/%Y, %I:%M:%S %p"), it parses "12:00:00 AM" as "12:00:00 PM", which is incorrect. I've added in some print statements in the C++ for now to try to figure out where this issue is happening—this is coming from strptime, and not arrow's date parser (which internally uses strptime). This issue does not affect Perspective at present, since the current parser simply does not parse 12-hour US locale strings.

UK locale strings seem to work fine in the same situation though :)

@sc1f
Copy link
Contributor Author

sc1f commented Jan 7, 2021

Closing in favor of #1282

@sc1f sc1f closed this Jan 7, 2021
@sc1f sc1f deleted the fix-datetime-filter-ux branch January 7, 2021 18:30
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.

1 participant