Format date string for viewof input

I am wanting help in formatting the date string when used in a viewof input - ideally it would display the hours - i.e. 1 am, 2 am, etc…

Like this? (You can find the docs for the format here.)

viewof timeCheck = Inputs.checkbox(
  d3.group(date_time, d => d.time_period),
  {
    label: "select hour",
    sort: "ascending",
    valueof: d => d[1],
    format: d => d3.timeFormat("%H:%M")(d[0])
  }
)

Edit: or

"%I %p"

for AM/PM.

Thank you - that is what I was looking for