Skip to content

Commit

Permalink
Merge pull request #734 from LiviaMedeiros/ft-time-title
Browse files Browse the repository at this point in the history
add `title` showing stream start time on watch page
  • Loading branch information
sphinxrave authored Oct 17, 2023
2 parents ead502b + f06c406 commit a4b5a21
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/components/watch/WatchInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
</router-link>
</v-card-title>
<v-card-subtitle>
{{ formattedTime }}
<span :class="'text-' + video.status" :title="absoluteTimeString">
{{ formattedTime }}
</span>
<span
v-if="video.status === 'live' && liveViewers"
class="live-viewers"
Expand Down Expand Up @@ -199,6 +201,17 @@ export default {
lang() {
return this.$store.state.settings.lang;
},
absoluteTimeString() {
const ts = localizedDayjs(this.video.available_at, this.lang);
const ts1 = ts.format(`${ts.isTomorrow() ? "ddd " : ""}LT zzz`);
const ts2 = ts
.tz("Asia/Tokyo")
.format(`${ts.isTomorrow() ? "ddd " : ""}LT zzz`);
if (ts1 === ts2) {
return ts1;
}
return `${ts1}\n${ts2}`;
},
formattedTime() {
switch (this.video.status) {
case "upcoming":
Expand Down

0 comments on commit a4b5a21

Please sign in to comment.