From 9583804890b546489579f2c9ccc5d9093fd63e44 Mon Sep 17 00:00:00 2001 From: Thomas Citharel <tcit@tcit.fr> Date: Wed, 10 Nov 2021 20:39:44 +0100 Subject: [PATCH] Only show datetime tz toggle if offset is different Signed-off-by: Thomas Citharel <tcit@tcit.fr> --- js/src/components/Event/EventFullDate.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/src/components/Event/EventFullDate.vue b/js/src/components/Event/EventFullDate.vue index 33c1d6176..8708993ad 100644 --- a/js/src/components/Event/EventFullDate.vue +++ b/js/src/components/Event/EventFullDate.vue @@ -111,6 +111,7 @@ </p> </template> <script lang="ts"> +import { getTimezoneOffset } from "date-fns-tz"; import { Component, Prop, Vue } from "vue-property-decorator"; @Component @@ -177,6 +178,8 @@ export default class EventFullDate extends Vue { return ( !!this.timezone && !!this.userActualTimezone && + getTimezoneOffset(this.timezone) !== + getTimezoneOffset(this.userActualTimezone) && this.timezone !== this.userActualTimezone ); }