feat: formatMonthYearRange — period now includes abbreviated month
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user