%= pb_content_tag(:div,
class: object.classname + object.error_class) do %>
<%= javascript_tag do %>
window.addEventListener("DOMContentLoaded", () => {
datePickerHelper(<%= object.date_picker_config %>, "<%= object.scroll_container %>")
if (<%= object.selection_type == "quickpick" %>) {
document.getElementById("<%= object.picker_id %>").addEventListener("change", ({ target }) => {
const startDate = document.getElementById("<%= object.start_date_id %>")
const endDate = document.getElementById("<%= object.end_date_id %>")
const splittedValue = target.value.split(" to ")
startDate.value = splittedValue[0]
endDate.value = splittedValue[1] ? splittedValue[1] : splittedValue[0]
})
}
})
<% end %>
<% end %>