Add better upload date formatting.

This commit is contained in:
FireMasterK 2021-10-08 17:52:55 +01:00
parent e8f8930932
commit 41ac97ed92
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD

View file

@ -27,7 +27,7 @@
<div class="uk-flex uk-flex-middle">
<div class="uk-margin-small-right">{{ addCommas(video.views) }} views</div>
<div class="uk-margin-small-right">{{ video.uploadDate }}</div>
<div class="uk-margin-small-right">{{ uploadDate }}</div>
<div class="uk-flex-1"></div>
<div class="uk-margin-small-left">
<font-awesome-icon class="uk-margin-small-right" icon="thumbs-up"></font-awesome-icon>
@ -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,