diff options
| author | Terry Truong <terry06890@gmail.com> | 2023-01-14 14:39:32 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2023-01-14 14:39:32 +1100 |
| commit | c58bb7b22a4ab7d1c6b3d264aeb47101652a13e5 (patch) | |
| tree | d471d5a2ca5526fc71794ab5f8ba91989509a3a1 /src | |
| parent | 05dd46c2f36787e71f4a3a3d7ac0febf3c6f9309 (diff) | |
Don't combine start/end times in info modal display
Combining them causes ambiguity between
starts with imprecision and starts with ends.
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/InfoModal.vue | 13 |
1 files changed, 8 insertions, 5 deletions
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'){ |
