merge-upstream-5.0.1 #66
|
@ -12,30 +12,24 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { formatTimeString } from "@/filters/datetime";
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import { useI18n } from "vue-i18n";
|
|
||||||
|
|
||||||
import Clock from "vue-material-design-icons/ClockTimeTenOutline.vue";
|
import Clock from "vue-material-design-icons/ClockTimeTenOutline.vue";
|
||||||
|
|
||||||
const { locale } = useI18n({ useScope: "global" });
|
|
||||||
|
|
||||||
const localeConverted = locale.replace("_", "-");
|
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
date: string;
|
date: string;
|
||||||
|
timezone?: string;
|
||||||
small?: boolean;
|
small?: boolean;
|
||||||
}>(),
|
}>(),
|
||||||
{ small: false }
|
{ small: false, timezone: "Etc/UTC" }
|
||||||
);
|
);
|
||||||
|
|
||||||
const dateObj = computed<Date>(() => new Date(props.date));
|
const dateObj = computed<Date>(() => new Date(props.date));
|
||||||
|
|
||||||
const time = computed<string>(() =>
|
const time = computed<string>(() =>
|
||||||
dateObj.value.toLocaleTimeString(localeConverted, {
|
formatTimeString(props.date, props.timezone)
|
||||||
hour: "2-digit",
|
|
||||||
minute: "2-digit",
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const smallStyle = computed<string>(() => (props.small ? "0.9" : "2"));
|
const smallStyle = computed<string>(() => (props.small ? "0.9" : "2"));
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
>
|
>
|
||||||
<start-time-icon
|
<start-time-icon
|
||||||
:date="event.beginsOn.toString()"
|
:date="event.beginsOn.toString()"
|
||||||
|
:timezone="event.options.timezone ?? undefined"
|
||||||
class="absolute right-3 -top-16"
|
class="absolute right-3 -top-16"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue