HI!
I am trying to figure out what my options are for having a time picker with AM/PM instead of 24 hour time. I see that the one used in the Vue dashboard that I have uses ElementPlus and they don't seem to have the AM/PM feature (at least as far as I can tell).
Are there any other options available?
Also, is it possible to use the limit time range feature (disabledHours) of ElementPlus?
Hi,
Add format="hh:mm:ss A"
on your el-time-picker
to use AM/PM time input.
Here is an example:
<el-time-picker v-model="value" placeholder="am/pm time input" format="hh:mm:ss A" />
disabledHours
property.<el-time-picker
v-model="value"
placeholder="am/pm time input"
format="hh:mm:ss A"
:disabledHours="disabledHours"
/>
const makeRange = (start: number, end: number) => {
const result: number[] = [];
for (let i = start; i <= end; i++) {
result.push(i);
}
return result;
};
const disabledHours = () => {
// will return array to disable hours from midnight till 8AM
return makeRange(0, 8);
};