Skip to content

Commit

Permalink
make luxon use the I18n locale in the i18n string
Browse files Browse the repository at this point in the history
  • Loading branch information
FinnIckler committed Jan 10, 2025
1 parent 4c06b25 commit adc8e02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion app/webpacker/components/MyCompetitions/TableCells.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export function LocationTableCell({ competition }) {
}

export function DateTableCell({ competition }) {
console.log(competition);
return (
<Table.Cell>
{dateRange(competition.start_date, competition.end_date, { separator: '-' })}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ const competingStatusIcon = (competingStatus) => {

const registrationStatusIconText = (competition) => {
if (competition.registration_status === 'not_yet_opened') {
return I18n.t('competitions.index.tooltips.registration.opens_in', { duration: DateTime.fromISO(competition.registration_open).toRelative() });
return I18n.t('competitions.index.tooltips.registration.opens_in', { duration: DateTime.fromISO(competition.registration_open).toRelative({ locale: window.I18n.locale }) });
}
if (competition.registration_status === 'past') {
return I18n.t('competitions.index.tooltips.registration.closed', { days: DateTime.fromISO(competition.start_date).toRelative() });
return I18n.t('competitions.index.tooltips.registration.closed', { days: DateTime.fromISO(competition.start_date).toRelative({ locale: window.I18n.locale }) });
}
if (competition.registration_status === 'full') {
return I18n.t('competitions.index.tooltips.registration.full');
Expand Down

0 comments on commit adc8e02

Please sign in to comment.