Tri des expériences par date de fin décroissante puis date de début (parcours et /code, FR/EN/AR)
This commit is contained in:
parent
366d18764b
commit
f32cd09940
4 changed files with 24 additions and 4 deletions
|
|
@ -56,7 +56,12 @@ function computeDuration(startStr: string, endStr?: string) {
|
|||
|
||||
const experiences = (await getLocalizedCollection("experiences", locale))
|
||||
.filter((e) => !e.data.draft)
|
||||
.sort((a, b) => (b.data.startDate! > a.data.startDate! ? 1 : -1));
|
||||
.sort((a, b) => {
|
||||
const endA = a.data.endDate ?? '9999-12';
|
||||
const endB = b.data.endDate ?? '9999-12';
|
||||
if (endA !== endB) return endB > endA ? 1 : -1;
|
||||
return b.data.startDate! > a.data.startDate! ? 1 : -1;
|
||||
});
|
||||
|
||||
const presentLabel = t('career', 'present', locale);
|
||||
const logoAltPrefix = t('career', 'logoAlt', locale);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,12 @@ const projectsBasePath = getProjectsBasePath(locale);
|
|||
|
||||
const experiences = (await getLocalizedCollection("experiences", locale))
|
||||
.filter((e) => !e.data.draft)
|
||||
.sort((a, b) => (b.data.startDate > a.data.startDate ? 1 : -1));
|
||||
.sort((a, b) => {
|
||||
const endA = a.data.endDate ?? '9999-12';
|
||||
const endB = b.data.endDate ?? '9999-12';
|
||||
if (endA !== endB) return endB > endA ? 1 : -1;
|
||||
return b.data.startDate > a.data.startDate ? 1 : -1;
|
||||
});
|
||||
|
||||
const recentExperiences = experiences.filter((e) => e.data.featured).slice(0, 4);
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,12 @@ const projectsBasePath = getProjectsBasePath(locale);
|
|||
|
||||
const experiences = (await getLocalizedCollection("experiences", locale))
|
||||
.filter((e) => !e.data.draft)
|
||||
.sort((a, b) => (b.data.startDate > a.data.startDate ? 1 : -1));
|
||||
.sort((a, b) => {
|
||||
const endA = a.data.endDate ?? '9999-12';
|
||||
const endB = b.data.endDate ?? '9999-12';
|
||||
if (endA !== endB) return endB > endA ? 1 : -1;
|
||||
return b.data.startDate > a.data.startDate ? 1 : -1;
|
||||
});
|
||||
|
||||
const recentExperiences = experiences.filter((e) => e.data.featured).slice(0, 4);
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,12 @@ const projectsBasePath = getProjectsBasePath(locale);
|
|||
|
||||
const experiences = (await getLocalizedCollection("experiences", locale))
|
||||
.filter((e) => !e.data.draft)
|
||||
.sort((a, b) => (b.data.startDate > a.data.startDate ? 1 : -1));
|
||||
.sort((a, b) => {
|
||||
const endA = a.data.endDate ?? '9999-12';
|
||||
const endB = b.data.endDate ?? '9999-12';
|
||||
if (endA !== endB) return endB > endA ? 1 : -1;
|
||||
return b.data.startDate > a.data.startDate ? 1 : -1;
|
||||
});
|
||||
|
||||
const recentExperiences = experiences.filter((e) => e.data.featured).slice(0, 4);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue