Skip to content

Commit

Permalink
edit formatDate fn to return same date format for both en and bg lang…
Browse files Browse the repository at this point in the history
…uage
  • Loading branch information
viiktorstefanov committed Sep 20, 2024
1 parent c3456ad commit 6561a90
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/common/util/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ export const formatDate = 'dd MMM yyyy'
export const formatDatetime = 'dd MMM yyyy HH:mm:ss'

export const formatDateString = (dateString: string | Date, language?: string) => {
const date = new Date(dateString)

const day = String(date.getDate()).padStart(2, '0')
const month = String(date.getMonth() + 1).padStart(2, '0')
const year = date.getFullYear()

return `${day}.${month}.${year}`
return format(new Date(dateString), 'dd.MM.yyyy')
}

const matchLocale = (language?: string): Locale => {
Expand Down

0 comments on commit 6561a90

Please sign in to comment.