From c58bb7b22a4ab7d1c6b3d264aeb47101652a13e5 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Sat, 14 Jan 2023 14:39:32 +1100
Subject: Don't combine start/end times in info modal display

Combining them causes ambiguity between
starts with imprecision and starts with ends.
---
 src/components/InfoModal.vue | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

(limited to 'src/components/InfoModal.vue')

diff --git a/src/components/InfoModal.vue b/src/components/InfoModal.vue
index 0b46be0..f709676 100644
--- a/src/components/InfoModal.vue
+++ b/src/components/InfoModal.vue
@@ -9,9 +9,9 @@
 		</h1>
 		<!-- Time Display -->
 		<div class="text-center text-sm md:text-base">
-			{{datesDisplayStrs.length == 1 ? 'Time' : 'Start'}}: {{datesDisplayStrs[0]}}
+			Start: {{datesDisplayStrs[0]}}
 		</div>
-		<div v-if="datesDisplayStrs.length > 1" class="text-center text-sm md:text-base">
+		<div v-if="datesDisplayStrs[1] != null" class="text-center text-sm md:text-base">
 			End: {{datesDisplayStrs[1]}}
 		</div>
 		<!-- Main content -->
@@ -82,7 +82,7 @@ import SCollapsible from './SCollapsible.vue';
 import CloseIcon from './icon/CloseIcon.vue';
 import DownIcon from './icon/DownIcon.vue';
 import ExternalLinkIcon from './icon/ExternalLinkIcon.vue';
-import {EventInfo, eventDatesToStrings, getImagePath} from '../lib';
+import {EventInfo, boundedDateToStr, getImagePath} from '../lib';
 import {useStore} from '../store';
 
 // Refs
@@ -100,8 +100,11 @@ const emit = defineEmits(['close']);
 
 // For data display
 const event = computed(() => props.eventInfo.event)
-const datesDisplayStrs = computed(
-	() => eventDatesToStrings(event.value.start, event.value.startUpper, event.value.end, event.value.endUpper));
+const datesDisplayStrs = computed(() => {
+	let startStr = boundedDateToStr(event.value.start, event.value.startUpper);
+	let endStr = event.value.end == null ? null : boundedDateToStr(event.value.end, event.value.endUpper);
+	return [startStr, endStr];
+});
 function licenseToUrl(license: string){
 	license = license.toLowerCase().replaceAll('-', ' ');
 	if (license == 'cc0'){
-- 
cgit v1.2.3

