export function createDateFormatter ( locales , options = { year : "numeric" , month : "numeric" , day : "numeric" , hour : "numeric" , minute : "numeric" , second : "numeric" , } ) { return new Intl . DateTimeFormat ( locales , options ) ; } export function formatDate ( date , locales ) { const formatter = createDateFormatter ( locales ) ; const formattedDate = formatter . format ( date ) ; return formattedDate ; }