Merge branch 'dev' into oauth2

This commit is contained in:
Sam
2022-07-03 19:05:38 +02:00
176 changed files with 3782 additions and 2122 deletions

View File

@ -1,15 +1,17 @@
/* eslint-disable import/no-duplicates */
import { Locale } from 'date-fns'
import { enUS, fr } from 'date-fns/locale'
import { de, enUS, fr } from 'date-fns/locale'
import createI18n from '@/i18n'
export const localeFromLanguage: Record<string, Locale> = {
de: de,
en: enUS,
fr: fr,
}
export const languageLabels: Record<string, string> = {
de: 'Deutsch',
en: 'English',
fr: 'Français',
}

View File

@ -1,6 +1,6 @@
import { ITranslatedSport } from '@/types/sports'
import { TUnit } from '@/types/units'
import { IRecord, IRecordsBySports } from '@/types/workouts'
import { ICardRecord, IRecord, IRecordsBySports } from '@/types/workouts'
import { formatWorkoutDate, getDateWithTZ } from '@/utils/dates'
import { convertDistance, units } from '@/utils/units'
@ -45,6 +45,12 @@ export const formatRecord = (
}
}
export const sortRecords = (a: ICardRecord, b: ICardRecord): number => {
const recordALabel = a.label.toLowerCase()
const recordBLabel = b.label.toLowerCase()
return recordALabel > recordBLabel ? 1 : recordALabel < recordBLabel ? -1 : 0
}
export const getRecordsBySports = (
records: IRecord[],
translatedSports: ITranslatedSport[],