Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add display of sector #515

Merged
merged 4 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/fragmentarium/domain/archaeology.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ test.each([
primaryContext: true,
notes: 'General notes.',
},
'some sector > some area > a house (Residential), II (1200 BCE - 1150 BCE), ' +
'some sector > some area > a house (Residential), II (1200 BCE 1150 BCE), ' +
'Room 42, On the floor (primary context). General notes.',
'de-DE',
],
Expand All @@ -153,31 +153,31 @@ test.each([
[
'with area and notes',
{ area: 'some area', notes: 'General notes.' },
'some area > a house (Residential), II (1200 BCE - 1150 BCE). General notes.',
'some area > a house (Residential), II (1200 BCE 1150 BCE). General notes.',
'de-DE',
],
[
'without area or notes',
{ sector: '', area: '' },
'a house (Residential), II (1200 BCE - 1150 BCE).',
{ area: '' },
'a house (Residential), II (1200 BCE 1150 BCE).',
'en-US',
],
[
'without notes',
{ notes: '' },
'a house (Residential), II (1200 BCE - 1150 BCE).',
'a house (Residential), II (1200 BCE 1150 BCE).',
'en-US',
],
[
'without building',
{ building: '' },
'(Residential), II (1200 BCE - 1150 BCE).',
'(Residential), II (1200 BCE 1150 BCE).',
'de-DE',
],
[
'without buildingType',
{ buildingType: null },
'a house, II (1200 BCE - 1150 BCE).',
'a house, II (1200 BCE 1150 BCE).',
'en-US',
],
[
Expand All @@ -191,7 +191,7 @@ test.each([
{
date: { ...defaultParams.date, notes: 'date notes' },
},
'a house (Residential), II (1200 BCE - 1150 BCE, date notes).',
'a house (Residential), II (1200 BCE 1150 BCE, date notes).',
'en-US',
],
[
Expand Down
2 changes: 1 addition & 1 deletion src/fragmentarium/domain/archaeology.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class Findspot {
private dateString(): string {
const start = this.date?.start.toString()
const end = this.date?.end?.toString()
const range = join([start, end], ' - ')
const range = end ? `${start} – ${end}` : start

return join([range, this.date?.notes], ', ')
}
Expand Down
2 changes: 1 addition & 1 deletion src/fragmentarium/domain/archaeologyDtos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function fromDateRangeDto(dto: DateRangeDto): DateRange {
return {
...dto,
start: createPartialDate(dto.start),
end: createPartialDate(dto.end),
end: dto.end ? createPartialDate(dto.end) : null,
}
}

Expand Down
Loading