I am using a <lightning:input type="time"/>
component and the picker is displayed to the user in 12 hour time with an AM/PM picker.
I want to display this value to the user in a table and the value is stored as a 24 hour string. Is there a component I can use to display this in 12 hour format, or do I need to parse out the time and manipulate it myself to display it in the 12 hour format?
Input:
<lightning:layoutItem size="6">
<lightning:input type="time" label="Start Time" name="start" value="{!v.startTime}" required="true" aura:id="required"/>
</lightning:layoutItem>
<lightning:layoutItem size="6">
<lightning:input type="time" label="End Time" name="end" value="{!v.endTime}" required="true" aura:id="required"/>
</lightning:layoutItem>
Output:
<tr>
<td class="slds-text-body_small">{!v.appointment.startTime}</td>
<td class="slds-text-body_small">{!v.appointment.endTime}</td>
</tr>