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

date, year, month and day querystring lookups #36

Closed
4 tasks
simonw opened this issue Oct 25, 2017 · 3 comments
Closed
4 tasks

date, year, month and day querystring lookups #36

simonw opened this issue Oct 25, 2017 · 3 comments

Comments

@simonw
Copy link
Owner

simonw commented Oct 25, 2017

  • ?timestamp___date=2017-07-17 - return every item where the timestamp falls on that date
  • ?timestamp___year=2017 - return every item where the timestamp falls within 2017
  • ?timestamp___month=1 - return every item where the month component is January
  • ?timestamp___day=10 - return every item where the day-of-the-month component is 10

Follow on from #23

@simonw simonw added this to the v1 stretch goals milestone Oct 25, 2017
@simonw simonw modified the milestones: v1 stretch goals, v2: visualization edition Nov 14, 2017
@simonw
Copy link
Owner Author

simonw commented Nov 17, 2017

Consider for example https://fivethirtyeight.datasettes.com/fivethirtyeight/inconvenient-sequel%2Fratings

fivethirtyeight__inconvenient-sequel_ratings

The idea here is to be able to support querystring parameters like this:

  • ?timestamp___date=2017-07-17 - return every item where the timestamp falls on that date
  • ?timestamp___year=2017 - return every item where the timestamp falls within 2017
  • ?timestamp___month=1 - return every item where the month component is January
  • ?timestamp___day=10 - return every item where the day-of-the-month component is 10

This is similar to #64 but a fair bit more complicated.

SQLite date functions are documented here: https://sqlite.org/lang_datefunc.html

@simonw
Copy link
Owner Author

simonw commented Nov 18, 2017

@simonw simonw modified the milestones: v2: visualization edition, Advanced JSON edition Dec 10, 2017
@simonw
Copy link
Owner Author

simonw commented May 28, 2018

I've changed my mind about this.

"Select every record on the 3rd day of the month" doesn't strike me as an actually useful feature.

"Select every record in 2018 / in May 2018 / on 1st May 2018", if you are using the SQLite-preferred datestring format, are already supported using LIKE queries (or the startswith filter):

@simonw simonw closed this as completed May 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant