diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index fabfd3c1..f69c3419 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -27,7 +27,7 @@
{{ addCommas(video.views) }} views
-
{{ video.uploadDate }}
+
{{ uploadDate }}
@@ -318,14 +318,24 @@ export default { }, }, computed: { + isListening(_this) { + return _this.getPreferenceBoolean("listen", false); + }, toggleListenUrl(_this) { const url = new URL(window.location.href); - url.searchParams.set("listen", _this.getPreferenceBoolean("listen", false) ? "0" : "1"); + url.searchParams.set("listen", _this.isListening ? "0" : "1"); return url.href; }, isEmbed(_this) { return String(_this.$route.path).indexOf("/embed/") == 0; }, + uploadDate(_this) { + return new Date(_this.video.uploadDate).toLocaleString(undefined, { + month: "short", + day: "numeric", + year: "numeric", + }); + }, }, components: { Player,