Date picker based on connectMenu (renderMenuSelect)

Hi,

I’ve created a custom widget for a date picker (powered by flatpickr) based on connectNumericMenu. I’ve also tested these recipes based on connectRange:


It is working OK, but it shows all dates and when the user selects a date, it applies a start condition.

It would be perfect if the date picker could show only the enabled dates dynamically. Check the control example “Disabling all dates except select few” https://flatpickr.js.org/examples/

Based on the connectMenu (renderMenuSelect), using this recipe: https://www.algolia.com/doc/api-reference/widgets/menu-select/js/#full-example, it almost works. However, the refine does not apply the start criteria.

Is it possible to change the behaviour of the connectMenu refine?

Thanks,
Anibal

Hello Anibal,

It is not possible to change the behaviour of the connectMenu refine, but for your case you may prefer to create a full custom widget instead of using connectMenu so you can have more control on the refinements to apply: https://www.algolia.com/doc/guides/building-search-ui/widgets/create-your-own-widgets/js/

If you still need more guidance, could you reproduce your case in codesandbox (you can use the following template: https://codesandbox.io/s/github/algolia/create-instantsearch-app/tree/templates/instantsearch.js)? So we’ll get a better view of what is the problem.

Regards.