Tabulator date filter not working

Example:

days = 5
periods = 3 * days

df = pandas.DataFrame(
    dict(
      dt=pandas.date_range('2023-01-01', periods=periods, freq='8H')
    , j=numpy.random.randint(10, 99, periods))
  )

editors = dict(dt=bokeh.models.widgets.tables.DateEditor())
formatters = dict(dt=bokeh.models.widgets.tables.DateFormatter(format='%Y-%m-%d'))
header_filters = dict(dt=dict(type='date', func='like'))

tabulator = panel.widgets.Tabulator(df, show_index=False, disabled=True, width=400, layout='fit_columns'
  , editors=editors
  , formatters=formatters
  , header_filters=header_filters
  )
tabulator.servable()

This renders the values fine and even shows the filter:

image

but the filter does not work:

image

i.e. it hides all rows.

Any ideas if this can be done?

I’ve reported this as a bug. See Tabulator date type header_filter not working · Issue #4543 · holoviz/panel (github.com).

A workaround might be to use an extra dt_str column holding the dates as a string and then displaying + filtering on that column instead.

1 Like