Skip to content

Commit

Permalink
Update src/utils/getFormattedDate.js
Browse files Browse the repository at this point in the history
Change default function to arrow function, change function body

Co-authored-by: Demian Parkhomenko <[email protected]>
  • Loading branch information
firehawk89 and DemianParkhomenko authored Sep 24, 2023
1 parent 7d154f2 commit 1660f44
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/utils/getFormattedDate.js
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit 1660f44

Please sign in to comment.