I'm encountering difficulties when it comes to generating AM/PM using moment.js. Currently, both my start time and end time are displaying in the AM format as shown below:
https://i.sstatic.net/DtinC.png
I would like the end time to be in PM. Any assistance with this issue would be greatly appreciated. Below you will find my code along with an image of the API data for reference.
return (
<ScrollView style={[GlobalStyle.CustomScrollView]}>
<HeaderBar3/>
<Text style={[GlobalStyle.EventTitle]}> Event Details</Text>
<View style={[GlobalStyle.EventDetailView]}>
<Image style={[GlobalStyle.EventDetailImage]} source={{uri: eventData.main_image}} resizeMode="contain"/>
<Text style={[GlobalStyle.EventSubtitle]}>Date:</Text>
<Text style={[GlobalStyle.EventDate]}>{moment(eventData.starts_on).format('DD MMMM YYYY')}</Text>
<Text style={[GlobalStyle.EventTime]}>{moment(eventData.starts_on).format('hh:mm A')} {'-'} {moment(eventData.ends_on).format('hh:mm A')}</Text>
API Data Image: