I have a question about scraping JSON data from a URL. The timestamps are in military time and I'm looking for a way to convert them to standard time on the client side.
Here is the JSON snippet:
[
{
SaturdayClose: "21:00",
SaturdayOpen: "10:00",
SundayClose: "12:00",
SundayOpen: "18:00",
WeekdayClose: "21:00",
WeekdayOpen: "10:00"
}
]
This is my index.html file:
<p>
Sun: ${ SundayOpen }a - ${ SundayClose }p Mon - Sat: ${ SaturdayOpen }a ${ SaturdayClose }p
</p>
However, the output looks messy:
Sun: 18:00a - 12:00p Mon - Sat: 10:00a 21:00p
I would prefer it to look like this:
Sun: 6:00a - 12:p Mon - Sat: 10:00a - 9:00p