diff --git a/src/utils/getFormattedDate.js b/src/utils/getFormattedDate.js index 011444b..0e46832 100644 --- a/src/utils/getFormattedDate.js +++ b/src/utils/getFormattedDate.js @@ -1,9 +1,7 @@ -export default function getFormattedTime(timestamp, options) { - const { format: formatTime } = new Intl.DateTimeFormat('en', { - hour: options.hourOptions, - minute: options.minuteOptions, +export const timeFormatter = (options) => + new Intl.DateTimeFormat('en', { + hour: '2-digit', + minute: '2-digit', hour12: false, + ...options, }) - - return formatTime(timestamp) -}