1

I want to use rome datetimepicker. If the user selects date do not hide the datetime picker. Hide it only after time selection. I am using this library https://bevacqua.github.io/rome/

anduplats
  • 885
  • 2
  • 14
  • 24

1 Answers1

0

Setting the autoClose to time hides the picker only after the user selects a time. Otherwise, it will keep the picker visible:

The documentation reference:

autoClose: When set to true, the calendar is auto-closed when picking a day _(or a time if time: true and date: false). A value of 'time' will only auto-close the calendar when a time is picked.

And here you can see an example using those same configuration:

const input = document.querySelector('#input')
rome(input, {
  autoClose: 'time'
})
<link href="https://cdn.jsdelivr.net/npm/rome@3.0.0/dist/rome.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/rome@3.0.0/dist/rome.min.js"></script>

<input id="input" autocomplete="off" />
a--m
  • 4,716
  • 1
  • 39
  • 59