import { FrontendLocaleData } from "../types" ; import { useAmPm } from "./use_am_pm" ; param dateObj param locale returns export const formatTime = ( dateObj , locale ) => formatTimeMem ( locale ) . format ( dateObj ) ; const formatTimeMem = ( locale ) => new Intl . DateTimeFormat ( locale . language , { hour : "numeric" , minute : "2-digit" , hour12 : useAmPm ( locale ) , } ) ; param dateObj param locale returns export const formatTimeWithSeconds = ( dateObj , locale ) => formatTimeWithSecondsMem ( locale ) . format ( dateObj ) ; const formatTimeWithSecondsMem = ( locale ) => new Intl . DateTimeFormat ( locale . language , { hour : useAmPm ( locale ) ? "numeric" : "2-digit" , minute : "2-digit" , second : "2-digit" , hour12 : useAmPm ( locale ) , } ) ; param dateObj param locale returns export const formatTimeWeekday = ( dateObj , locale ) => formatTimeWeekdayMem ( locale ) . format ( dateObj ) ; const formatTimeWeekdayMem = ( locale ) => new Intl . DateTimeFormat ( locale . language , { hour : useAmPm ( locale ) ? "numeric" : "2-digit" , minute : "2-digit" , second : "2-digit" , hour12 : useAmPm ( locale ) , } ) ;