Closed chipit24 closed 7 years ago
I have my component set up like so:
<Kronos time={this.state.selectedTime} format={'h:mm a'} onChangeDateTime={this.handleTime.bind(this)} placeholder="Time" />
Which results in the format of the time in the dropdown to be shown correctly:
However, when I add timeStep, the time in the dropdown is now formatted in 24-hour time:
timeStep
The issue seems to be with this: https://github.com/dubert/react-kronos/blob/master/src/calendar.js#L244. The README mentions:
hour: - string : default: h:mm a
But looking at the source, it seems that minute is used, and the default is HH:mm, and not h:mm a.
minute
HH:mm
h:mm a
To get things working how I want, I had to set:
options={{ format: {minute: 'h:mm a'} }}
Had the same issue here.
Just released 1.6.0!
This issue should be addressed, let me know if it is not.
I have my component set up like so:
Which results in the format of the time in the dropdown to be shown correctly:
However, when I add
timeStep
, the time in the dropdown is now formatted in 24-hour time:The issue seems to be with this: https://github.com/dubert/react-kronos/blob/master/src/calendar.js#L244. The README mentions:
But looking at the source, it seems that
minute
is used, and the default isHH:mm
, and noth:mm a
.To get things working how I want, I had to set: