Files
livetrail/src/components/ProjectRelTime.vue
T
2026-08-27 12:45:30 +02:00

37 lines
877 B
Vue

<script>
import appIcon from '@components/AppIcon';
export default {
components: {
appIcon
},
props: {
localTime: String,
siteTime: String,
offset: String,
classes: String,
icon: String,
titleWrapperLangId: String
},
inject: ['lang'],
computed: {
title() {
const bDifferentTimeZone = (this.localTime != this.siteTime);
const sTime =
this.lang.get('time.user', this.siteTime.slice(-5))
+ ((this.offset != '0')?' ('+this.lang.get('unit.day_short')+this.offset+')':'');
return (this.titleWrapperLangId)?
this.lang.get(this.titleWrapperLangId, bDifferentTimeZone?sTime:this.siteTime)
:
(bDifferentTimeZone?sTime:null);
}
}
};
</script>
<template>
<appIcon v-if="icon" :icon="icon" :title="title" :text="localTime" width="fixed" size="lg" />
<span v-else :class="classes" :title="title">{{ localTime }}</span>
</template>