Timepicker parameters as input to painless scripts

Is it currently possible to pass the timepicker values as input parameters to runtime painless scripts? The question occurs because I would like to dynamically calculate some time interval value sums, which are calculated differently in some months of the year, and lower / upper bound them according with the timepicker values.

You can pass params to runtime fields.

params are passed as json so any param would have to be one of the json types (string, map, boolean, etc).

What do you mean by timepicker values? Can you sketch what you're trying to do?

Hi. Thx for the response in such a short notice.
I mean the time filters, use the start /end values of a selected time range as input params to a scripted field.

Ahh interesting case. Unfortunately, that's not available.

Runtime fields do not have access to the surrounding query and so those values are not available to the field.

They would have to be manually passed in via params, which is not available in kibana discover.