Skip to content

Commit c7fe712

Browse files
committed
Revert changes
1 parent 70a7ece commit c7fe712

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
<script setup lang="ts">
22
import { onMounted, onUnmounted, ref } from "vue";
33
import moment from "moment";
4-
import { Tippy } from "vue-tippy";
54
65
const emptyDate = "0001-01-01T00:00:00";
76
87
const props = withDefaults(defineProps<{ dateUtc?: string; defaultTextOnFailure?: string; titleValue?: string }>(), { dateUtc: emptyDate, defaultTextOnFailure: "n/a", titleValue: undefined });
98
109
let interval: number | undefined = undefined;
1110
12-
const title = ref<string[]>([]),
11+
const title = ref(),
1312
text = ref();
1413
1514
function updateText() {
1615
if (props.dateUtc != null && props.dateUtc !== emptyDate) {
1716
const m = moment.utc(props.dateUtc);
1817
text.value = m.fromNow();
19-
title.value = props.titleValue ? [props.titleValue] : [`${m.local().format("LLLL")} (local)`, `${m.utc().format("LLLL")} (UTC)`];
18+
title.value = props.titleValue ?? m.local().format("LLLL") + " (local)\n" + m.utc().format("LLLL") + " (UTC)";
2019
} else {
2120
text.value = props.defaultTextOnFailure;
22-
title.value = [props.titleValue ?? props.defaultTextOnFailure];
21+
title.value = props.titleValue ?? props.defaultTextOnFailure;
2322
}
2423
}
2524
@@ -35,10 +34,5 @@ onUnmounted(() => window.clearInterval(interval));
3534
</script>
3635

3736
<template>
38-
<Tippy>
39-
<template #content>
40-
<div v-for="row in title" :key="row">{{ row }}</div>
41-
</template>
42-
<span>{{ text }}</span>
43-
</Tippy>
37+
<span :title="title">{{ text }}</span>
4438
</template>

0 commit comments

Comments
 (0)