Numerical/Decimal Value | XM Community
Skip to main content
Question

Numerical/Decimal Value

  • April 27, 2022
  • 1 reply
  • 82 views

Hi all,
I have a question on my survey scale that asks about time. I've put questions as a form field as we need respondents to mention the exact time. We've requested them to adapt a 24-hour time scale i.e. 23:00 instead of 11 pm. In the edit validation, I've selected numerical values only. However, it doesn't allow decimals. Any idea how to get this into a 24-hour time scale? Thanks so much.

1 reply

jmborzick
QPN Level 5 ●●●●●
Forum|alt.badge.img+41
  • QPN Level 5 ●●●●●
  • April 28, 2022

Charmi I'd recommend using Flatpickr for this.
Below is the JavaScript you'd need to add.
To the header:
https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css" rel="stylesheet" />">https://cdn.jsdelivr.net/npm/flatpickr">
To the question:

{
enableTime: true,
noCalendar: true,
dateFormat: "H:i",
time_24hr: true
}