feat: formatMonthYearRange — period now includes abbreviated month

This commit is contained in:
Ilia Mashkov
2026-05-18 13:01:58 +03:00
parent 1550989fd9
commit 48a08ec3fb
4 changed files with 52 additions and 45 deletions
@@ -65,12 +65,12 @@ describe('ExperienceSection', () => {
it('formats open-ended period as "Present"', async () => {
render(await ExperienceSection());
expect(screen.getByText('2022 — Present')).toBeInTheDocument();
expect(screen.getByText('Jan 2022 — Present')).toBeInTheDocument();
});
it('formats closed period with year range', async () => {
it('formats closed period with month and year range', async () => {
render(await ExperienceSection());
expect(screen.getByText('2020 — 2021')).toBeInTheDocument();
expect(screen.getByText('Jan 2020 — Dec 2021')).toBeInTheDocument();
});
it('renders description text', async () => {
@@ -1,7 +1,7 @@
import { ExperienceCard } from '$entities/experience';
import type { ExperienceRecord } from '$shared/api';
import { getCollection } from '$shared/api';
import { formatYearRange } from '$shared/lib';
import { formatMonthYearRange } from '$shared/lib';
/**
* Experience section component.
@@ -19,7 +19,7 @@ export default async function ExperienceSection() {
key={exp.id}
title={exp.role}
company={exp.company}
period={formatYearRange(exp.start_date, exp.end_date)}
period={formatMonthYearRange(exp.start_date, exp.end_date)}
description={exp.description}
stack={exp.stack}
/>