After X Days Ago Filter
We want to introduce a new view filter type that allows users to filter a date or datetime field value on to only match dates that were after or equal to the date which was X days ago. So, for example if the current date is 2023-05-09
and the users filters with the value 25 days, only rows where the date value is greater than or equals to 2023-04-14
(25 days ago) must be visible.
Note that every filter has two implementations, one in the backend and one in the web-frontend. The web-frontend checks in real time if the row still matches the filters. You can see how that works by for example creating a filter for a text field and then change a row value of that text field. It should indicate in real time if the row doesn't match the filters anymore. Like the example below.
Note that this filter must also respect and store the timezone that the creating user has. The TimezoneAwareDateViewFilterType
base class in the backend and LocalizedDateViewFilterType
class in the frontend should be extended as they provide framework for supporting timezones.
Pointers
- The timezone of the user that created the filter must be respected.
- The filter must be compatible with a date and with a datetime field.
- It must also work with the real time check of the value in the web-frontend.
- It must be clear in the API docs (https://api.baserow.io/api/redoc/) what value structure is expected.
- It must be clear in the automatically generated docs (https://baserow.io/api-docs) what value structure is expected.
- We need unit tests for the backend and for the web-frontend.
- We value high quality and clear documentated in our code.
- The real time check should work if you follow these steps
- Create a filter with the new weeks ago filter set
- Create a row which matches the filter
- Change the row so it no longer matches the filter and observe the orange warning pops up
- Clicking away from the changed row makes it disappear
Information
- More information about how the setup your development environment can be found here https://baserow.io/docs/development%2Fdevelopment-environment
- More information about how view filters work can be found here https://baserow.io/docs/plugins%2Fview-filter-type