Skip to content

Commit

Permalink
(PC-8066) fix last warning "Functions are not valid as a React child"
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinewg committed Apr 16, 2021
1 parent 0d53239 commit dba46af
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions src/libs/parsers/formatDates.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { t } from '@lingui/macro'

// javascript Date can't find them...
const MONTHS = [
'janvier',
Expand Down Expand Up @@ -69,7 +67,7 @@ export const formatDates = (timestamps?: number[]): string | undefined => {
const uniques = getUniqueSortedTimestamps(timestamps)
if (uniques.length === 0) return
if (uniques.length === 1) return formatToFrenchDate(uniques[0])
return t`Dès le ${formatToFrenchDate(uniques[0])}`
return `Dès le ${formatToFrenchDate(uniques[0])}`
}

export const formatDatePeriod = (dates: Date[] | undefined): string | undefined => {
Expand Down
1 change: 0 additions & 1 deletion src/locales/fr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,6 @@ msgid "Duo"
msgstr "Duo"

#: src/features/favorites/atoms/Favorite.tsx:46
#: src/libs/parsers/formatDates.ts:63
msgid "Dès le {0}"
msgstr "Dès le {0}"

Expand Down

0 comments on commit dba46af

Please sign in to comment.