Add support for 12 and 24 hour time formats (and add radio buttons) #33

Merged
twig merged 8 commits from time-format into main 2025-07-12 20:48:36 +00:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit 885fc5f906 - Show all commits

View file

@ -47,7 +47,7 @@
<span v-if="getDayDifference(date, currentDate) === 1">Yesterday at</span>
<span v-else-if="getDayDifference(date, currentDate) > 1 ">{{ date.toLocaleDateString(undefined) }},</span>
{{ date.toLocaleTimeString(undefined, { hour12: props.format=="12", timeStyle: "short" }) }}
{{ date.toLocaleTimeString(undefined, { hour12: props.format == "12", timeStyle: "short" }) }}
</span>
</div>
<div class="message-text" v-html="sanitized" tabindex="0"></div>

View file

@ -1,6 +1,6 @@
<template>
<div class="radio-buttons-container" ref="radioButtonsContainer">
<div v-for="index in incidies" :key="index" class="radio-button" @click="onClick(index)">
<div v-for="index in indices" :key="index" class="radio-button" @click="onClick(index)">
<span class="radio-button-radio"></span>
<span class="radio-button-text">{{ textStrings[index] }}</span>
</div>
@ -19,7 +19,7 @@ const props = defineProps<{
}>();
// makes an array from 0 to buttonCount - 1
const incidies = Array.from({ length: props.buttonCount }, (_, i) => i)
const indices = Array.from({ length: props.buttonCount }, (_, i) => i)
// select default selected button
onMounted(async () => {