import { FrontendLocaleData } from "../types" ; import { useAmPm } from "./use_am_pm" ; param dateObj param locale returns export const formatDateTime = ( dateObj , locale ) => formatDateTimeMem ( locale ) . format ( dateObj ) ; const formatDateTimeMem = ( locale ) => new Intl . DateTimeFormat ( locale . language , { year : "numeric" , month : "long" , day : "numeric" , hour : useAmPm ( locale ) ? "numeric" : "2-digit" , minute : "2-digit" , hour12 : useAmPm ( locale ) , } ) ; param dateObj param locale returns export const formatDateTimeWithSeconds = ( dateObj , locale ) => formatDateTimeWithSecondsMem ( locale ) . format ( dateObj ) ; const formatDateTimeWithSecondsMem = ( locale ) => new Intl . DateTimeFormat ( locale . language , { year : "numeric" , month : "long" , day : "numeric" , hour : useAmPm ( locale ) ? "numeric" : "2-digit" , minute : "2-digit" , second : "2-digit" , hour12 : useAmPm ( locale ) , } ) ; param dateObj param locale returns export const formatDateTimeNumeric = ( dateObj , locale ) => formatDateTimeNumericMem ( locale ) . format ( dateObj ) ; const formatDateTimeNumericMem = ( locale ) => new Intl . DateTimeFormat ( locale . language , { year : "numeric" , month : "numeric" , day : "numeric" , hour : "numeric" , minute : "2-digit" , hour12 : useAmPm ( locale ) , } ) ;