@@ -912,6 +912,20 @@ onMounted(async () => {
912912});
913913
914914const visitDurationString = computed <string >(() => {
915+ let date;
916+ if (recording .value ) {
917+ date = DateTime .fromJSDate (new Date (recording .value .recordingDateTime ));
918+ } else {
919+ date = DateTime .fromJSDate (new Date ());
920+ }
921+
922+ const now = new Date ();
923+ let dateString;
924+ if (date .year != now .getFullYear ()) {
925+ dateString = date .toFormat (" d MMM yy" );
926+ } else {
927+ dateString = date .toFormat (" d MMM" );
928+ }
915929 if (selectedVisit .value && locationContext && locationContext .value ) {
916930 const visit = selectedVisit .value as ApiVisitResponse ;
917931 const duration = visitDuration (visit , !! isDesktop .value );
@@ -924,12 +938,26 @@ const visitDurationString = computed<string>(() => {
924938 // If visitStart has the same suffix as visitEnd, omit it.
925939 visitStart = visitStart .replace (" am" , " " ).replace (" pm" , " " );
926940 }
927- return ` ${visitStart }–${visitEnd } (${duration }) ` ;
941+ return ` <strong>${ dateString }</strong>, ${visitStart }–${visitEnd } (${duration })` ;
928942 }
929- return " " ;
943+ return ` <strong>${ dateString }</strong> ` ;
930944});
931945
932946const recordingDurationString = computed <string >(() => {
947+ let date;
948+ if (recording .value ) {
949+ date = DateTime .fromJSDate (new Date (recording .value .recordingDateTime ));
950+ } else {
951+ date = DateTime .fromJSDate (new Date ());
952+ }
953+
954+ const now = new Date ();
955+ let dateString;
956+ if (date .year != now .getFullYear ()) {
957+ dateString = date .toFormat (" d MMM yy" );
958+ } else {
959+ dateString = date .toFormat (" d MMM" );
960+ }
933961 if (recording .value && locationContext && locationContext .value ) {
934962 const rec = recording .value as ApiRecordingResponse ;
935963 const durationMs = rec .duration * 1000 ;
@@ -951,9 +979,9 @@ const recordingDurationString = computed<string>(() => {
951979 // If visitStart has the same suffix as visitEnd, omit it.
952980 visitStart = visitStart .replace (" am" , " " ).replace (" pm" , " " );
953981 }
954- return ` ${visitStart }–${visitEnd } (${duration }) ` ;
982+ return ` <strong>${ dateString }</strong>, ${visitStart }–${visitEnd } (${duration })` ;
955983 }
956- return " " ;
984+ return ` <strong>${ dateString }</strong> ` ;
957985});
958986
959987const isDesktop = useMediaQuery (" (min-width: 992px)" );
@@ -1282,6 +1310,7 @@ const onScroll = (e: Event) => {
12821310 v-html =" visitDurationString"
12831311 class =" recording-header-time ms-2 ms-sm-2 text-secondary"
12841312 />
1313+ <span class =" recording-header-time ms-2 ms-sm-2 text-secondary" v-else v-html =" visitDurationString" ></span >
12851314 </div >
12861315 </div >
12871316 <div v-else >
0 commit comments