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 range text boxes #127

Closed
JG515 opened this issue Jun 16, 2023 · 7 comments
Closed

Date range text boxes #127

JG515 opened this issue Jun 16, 2023 · 7 comments

Comments

@JG515
Copy link

JG515 commented Jun 16, 2023

We have implemented the itemsjs demo that uses a list of movies and altered it slightly to fit it to our particular aggregations. How can we add "start date" and "end date" text boxes to filter items by date range? Thanks so much!

@cigolpl
Copy link
Member

cigolpl commented Jun 16, 2023

Could you share a screenshot of your desired solution from UX standpoint ? I am asking because this could be done in various ways.

@JG515
Copy link
Author

JG515 commented Jun 16, 2023

Thanks so much for getting back to us so quickly! Here is a screen shot with the kind of date range fields we would like to implement in our faceted search. We would like to do "Start Date" and "End Date" like below.

image

@JG515
Copy link
Author

JG515 commented Jun 21, 2023

One of our goals for this week is to implement the date range search. We look forward to getting your guidance on the best way to accomplish it. Thanks again!

@cigolpl
Copy link
Member

cigolpl commented Jun 21, 2023

You can totally tackle this UI issue using the filter function. There's a great example you can check out right here: https://github.com/itemsapi/itemsjs/blob/master/docs/configuration.md.

Also, just a heads up, you can create faceted filters that would look something like this:

Years:
"2023" -> 100 movies
"2022" -> 50 movies
"2021" -> 120 movies

Tags:
"Drama" -> 200 movies
"Western" -> 50 movies

This is really where itemsjs comes into its own and shows off what it can do. Hope this helps!

@JG515
Copy link
Author

JG515 commented Jun 22, 2023

How do we get the value of the text box into the filter function? It works when we hard code a number, but not when we try to get the value of the text box.

Please notice the number1 text box in the UI:

image

and how we tried to use it in the filter function:

image

full files attached

index.njk - Copy.txt
itemsjs-config.njk - Copy.txt

Thank you, Thank you!

@JG515
Copy link
Author

JG515 commented Jun 28, 2023

Can we get a little help hooking up the text box in the UI to the itemsjs library? Not sure how to make this work.

@cigolpl
Copy link
Member

cigolpl commented Jun 29, 2023

We have several examples of this in our demo documentation, which you can find at https://github.com/itemsapi/itemsjs/blob/master/docs/demo.md. These examples include implementations using Vue and native JS, showing how to hook up a text box with ItemsJS. Please take a look and see if these examples help you solve your problem

@cigolpl cigolpl closed this as completed Aug 6, 2023
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

2 participants