-
Notifications
You must be signed in to change notification settings - Fork 46
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
Custom date range selector #66
Comments
Do you mean to filter and show the events based on a custom date range on the dashboard? |
Exactly, using something like: https://ui.shadcn.com/docs/components/calendar It would support existing pre-defined ranges, but if the user wants a custom range they could use the calendar to pick a start/end date. This would involve changing the backend and frontend, as the backend expects keys like: "7d", "30d", etc, instead of start-end date. Are you interested in contributing to this issue as well? |
So, we shall be using components from shadcn here, right? As there is no |
There's a DatePicker on shadcn, I think we should use that one: https://ui.shadcn.com/docs/components/date-picker Yes, backend is in C#. Syntax is very similar to TypeScript, so you won't have much trouble with it :) I think we should implement this features in two steps:
What you think? |
Right, so the link that I shared above is built on top of the shadcn's DatePicker component which is more intuitive and easy to use. custom-date-picker.mp4I believe the component can be further modified to include the "All time" option if needed. |
That's looking great, better than I'd have thought, thank you @prajwalkulkarni Some feedback:
🚀 |
Hey @goenning need some input on how should we store and process the date input, since we are moving away from the predefined keys how should we send the selection range to the backend? My initial approach was to use two query params
It is actually a prop when passed shows the "vs" string between the two date ranges. I'm not passing it here so it is not visible however the "Compare" is still seen, we can remove it.
Yeah, I will look into it. |
I think it would be best to have the Eventually this will become a public API, and it'll be easier for developers to use these parameters as it's fairly standard to have a from/to parameters. If you do a That's why I suggested splitting this feature in 2 PRs. First change the backend/frontend to use from/to, while keeping the predefined keys only in frontend, then separate add the calendar UI which should then be a UI-only PR. What you think? |
Fair enough.
I did try with
Yeah, I think that is a good idea. I shall begin making changes on the backend first and then make UI changes as a separate PR. |
So I started by making the changes and looks like we'll have to update the parameter type of |
I think we should replace The period param internally simply converts to those 3 parameters anyway |
Instead of predefined ranges, let the user select what they want
The text was updated successfully, but these errors were encountered: