Skip to content

Add date range inputs#562

Draft
SteffenAstheimer wants to merge 2 commits intodevelopfrom
add-date-range-inputs
Draft

Add date range inputs#562
SteffenAstheimer wants to merge 2 commits intodevelopfrom
add-date-range-inputs

Conversation

@SteffenAstheimer
Copy link
Contributor

This should hopefully fit the needs described in issue #36.

before:
image
after:
image

The new input boxes are synchronized with the range slider and both update each other in real time. The filtering can be triggered both by changing the dates in the input field and by sliding the slider.

I went with receiving the input as plain text and testing for correct date formats in the JS portion. There are also some basic tests to make sure the input dates are within the allowed min and max range, and that the from date is actually lower than the to date. Although there is no feedback if the input is faulty and nothing happens – but also nothing crashes.

The allowed input date formats are bound to the language and are "DD.MM.YYYY" for german and "MM.DD.YYYY" for english respectively.

I adjusted the looks aswell. I removed the grid (since it was just showing random and confusing dates below the slider) and added some horizontal bars to make the grouping of different filter options more intuitive.

Please feel free to openly comment on the whole approach. I think it works rather nicely and apart from some error feedback I can't think of any major adjustments I would aim for.
I was thinking about implementing a switch that let's you decide between searching for a range / a specific date, but that felt overkill to implement for the time being. Same goes for having a pop-up calendar to input the dates and I'm not even sure if that is any user friendly if not done right.

add input boxes for from and to search date
move the chronology filter update logic into a helper function
add a method for date input to trigger chronology filter logic
connect slider and input boxes to display the same dates
prettify the slider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

direkte manuelle Einträge ins Datumsfeld (Briefe)

1 participant