rjaros / kvision

Object oriented web framework for Kotlin/JS
https://kvision.io
MIT License
1.2k stars 67 forks source link

DateTime picker shows AM/PM for 24-hour input #480

Closed Stephen-Hamilton-C closed 1 year ago

Stephen-Hamilton-C commented 1 year ago

In the KVision Showcase forms tab, the Time field display is in 24-hour time, but when you bring up the time picker, the input shows 12-hour time. While it still works fine, this is rather off-putting. I have experienced this same problem in my own code

rjaros commented 1 year ago

Hello. The problem is caused by the time format used by DateTime component. Currently it's hard-coded as "HH:mm" and doesn't take into account the browser locale. On the other hand, the time picker (TempusDominus) does support locale settings. As a temporary workaround you can try using DateTime(format = "hh:mm A") to use 12-hour time format in the input field. And I'll try to check if it's possible to automatically reuse TempusDominus locales settings and auto-detect the correct format.

rjaros commented 1 year ago

Fixed in 6.5.0