1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-21 15:32:32 +00:00

fix(home): ensure event hour displays correctly with timezone

Timezone parameter is now mandatory for <start-time-icon>.

Solves #1618
This commit is contained in:
Massedil 2024-12-13 16:23:09 +01:00 committed by setop
parent d485c7e113
commit 39b4356ea6
3 changed files with 5 additions and 4 deletions

View file

@ -81,6 +81,7 @@
:small="true"
v-if="!mergedOptions.hideDate && event.options.showStartTime"
:date="event.beginsOn.toString()"
:timezone="event.options.timezone"
/>
</div>
<span

View file

@ -20,16 +20,16 @@ import Clock from "vue-material-design-icons/ClockTimeTenOutline.vue";
const props = withDefaults(
defineProps<{
date: string;
timezone?: string;
timezone: string | null;
small?: boolean;
}>(),
{ small: false, timezone: "Etc/UTC" }
{ small: false }
);
const dateObj = computed<Date>(() => new Date(props.date));
const time = computed<string>(() =>
formatTimeString(props.date, props.timezone)
formatTimeString(props.date, props.timezone ?? undefined)
);
const smallStyle = computed<string>(() => (props.small ? "0.9" : "2"));

View file

@ -24,7 +24,7 @@
>
<start-time-icon
:date="event.beginsOn.toString()"
:timezone="event.options.timezone ?? undefined"
:timezone="event.options.timezone"
class="absolute right-3 -top-16"
/>
</div>