1
0
mirror of https://github.com/TeamPiped/Piped.git synced 2024-12-12 21:30:27 +05:30

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-flex uk-flex-middle">
<div class="uk-margin-small-right">{{ addCommas(video.views) }} views</div> <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-flex-1"></div>
<div class="uk-margin-small-left"> <div class="uk-margin-small-left">
<font-awesome-icon class="uk-margin-small-right" icon="thumbs-up"></font-awesome-icon> <font-awesome-icon class="uk-margin-small-right" icon="thumbs-up"></font-awesome-icon>
@ -318,14 +318,24 @@ export default {
}, },
}, },
computed: { computed: {
isListening(_this) {
return _this.getPreferenceBoolean("listen", false);
},
toggleListenUrl(_this) { toggleListenUrl(_this) {
const url = new URL(window.location.href); 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; return url.href;
}, },
isEmbed(_this) { isEmbed(_this) {
return String(_this.$route.path).indexOf("/embed/") == 0; 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: { components: {
Player, Player,