Skip to content

Commit

Permalink
chore: display only a datespan if the earliest and latest of the date…
Browse files Browse the repository at this point in the history
… is not the same
  • Loading branch information
oliviareichl committed Oct 10, 2024
1 parent 1d4e803 commit 43f010d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion components/mode-switch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ watch(
);
function entityHasCoordinates(entity: EntityFeature) {
console.log(entity);
if (!project.map.mapDisplayedSystemClasses.includes(entity.systemClass)) {
hasPlace.value = false;
}
Expand Down
3 changes: 3 additions & 0 deletions utils/create-date-span.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ export function createDateSpan(date: { earliest?: string | null; latest?: string
const segments: Array<string> = [];

if (date.earliest != null) {
if (date.earliest === date.latest) {
return d(date.earliest, { dateStyle: "long" });
}
segments.push(d(date.earliest, { dateStyle: "medium" }));
}
if (date.latest != null) {
Expand Down

0 comments on commit 43f010d

Please sign in to comment.