Merge branch 'dev' into oauth2
This commit is contained in:
@ -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',
|
||||
}
|
||||
|
@ -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[],
|
||||
|
Reference in New Issue
Block a user