Open eastcoastcoder opened 5 years ago
@ethanx94 you can customize the format of the hour display content.
such as
const formatAMPM = (date) => {
let hours = date.getHours();
let ampm = hours >= 12 ? 'pm' : 'am';;
hours = hours % 12;
hours = hours ? hours : 12; // the hour '0' should be '12'
return hours + ampm;
}
// ....
render() {
return (
<DatePicker
dateConfig={{
'hour': {
format: value => this.formatAMPM(value),
caption: 'æ—¶',
step: 1,
},
}} />
);
}
@lanjingling0510 Nice example, but the question is if it is possible to have AM/PM as a third element with possibility to scroll in the same way as minutes or hours
This library is awesome except for one flaw. There doesn't seem to be a way to set 12 hour time. rmc-date-picker supports this but has a lack of themes and the time doesn't seem to roll over continuously like this library. I was wondering if there is already support for this I'm just overlooking?