Closed yury-dymov closed 7 years ago
Thanks for reporting this. I investigated this issue, and the problem seems to be that here https://github.com/dubert/react-kronos/blob/master/src/calendar.js#L184-192 the format for the cells is forced. I should be able to update this. Look for an update in a few days!
Added the format prop to options in 1.3.0, so you can do:
<Kronos
options={{
format: {
hour: 'H:mm'
}
}}
/>
It will be 24h
First of all, thank you for quick update!
However, I assume that there can be a better solution. My project supports localization and I want that English users had 12-hour format and Russian users - 24-hour format. That means that format should be the same ('HH:mm' or 'H:mm' depends on personal preference) but rendering occurs with respect to selected locale.
Change the moment locale between 'en' and 'ru' and that should change the format.
Just released 1.6.0!
This issue should be fixed.
Hi, first of all thank you for nice library!
Here is the issue description:
My code: <Kronos time='15:00' format='HH:mm' options={{ moment: { lang: 'ru' } }}/>
In Russian we have 24 hour format by default. Initial value rendered fine and after selecting 7:30 PM from dropdown I can see 19:30, which is also fine.
The issue is that I am expecting to see 19:30 in the dropdown instead of 7:30 PM. I reviewed the source code and it seems that moment language option is never used for dropdown population.
Kind regards, Yuri.