Skip to content

A self-hosted media server and file management system

fix: duplicate "ago" in toTimeSpan on minutes

aminnausina33dbfa348d7
diff --git a/resources/js/components/video/VideoInfoPanel.vue b/resources/js/components/video/VideoInfoPanel.vue
index f2e34cb2..3a99c4dc 100755
--- a/resources/js/components/video/VideoInfoPanel.vue
+++ b/resources/js/components/video/VideoInfoPanel.vue
@@ -251,7 +251,10 @@ watch(
<template> </template>
<template v-if="stateVideo.date_uploaded">
<p>|</p>
- <p :title="`Date Uploaded: ${toFormattedDate(new Date(stateVideo.date_uploaded))}`" class="text-nowrap text-start truncate">
+ <p
+ :title="`Date Uploaded: ${toFormattedDate(new Date(stateVideo.date_uploaded))}\nDate Added: ${toFormattedDate(new Date(stateVideo.date_created))}`"
+ class="text-nowrap text-start truncate"
+ >
{{ toTimeSpan(stateVideo.date_uploaded, '') }}
</p>
</template>
diff --git a/resources/js/service/util.ts b/resources/js/service/util.ts
index b9b6d24e..1fb8b2c4 100644
--- a/resources/js/service/util.ts
+++ b/resources/js/service/util.ts
@@ -34,7 +34,7 @@ export function toTimeSpan(rawDate: Date | string, timeZoneName = ' EST', short?
} else if (hours > 0) {
timeSpan = `${hours}${units.hours}${handlePlural(hours)}`;
} else if (minutes > 0) {
- timeSpan = `${minutes}m ago`;
+ timeSpan = `${minutes}m`;
} else {
timeSpan = `${Math.max(1, seconds)}s`;
}