Now has all of the functions as the Astro site.
Signed-off-by: Louis Hollingworth <louis@hollingworth.ch>
This commit is contained in:
parent
2e98cb39f4
commit
f9e7e5480c
12 changed files with 2618 additions and 3316 deletions
28
components/TimeFormat.vue
Normal file
28
components/TimeFormat.vue
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<script setup lang="ts">
|
||||
import { defineComponent } from 'vue'
|
||||
type TimeFormatProps = {
|
||||
dateStyle: 'full' | 'long' | 'medium' | 'short',
|
||||
timeStyle: 'full' | 'long' | 'medium' | 'short',
|
||||
hour12: boolean
|
||||
}
|
||||
|
||||
const props = defineProps<
|
||||
{
|
||||
format: TimeFormatProps,
|
||||
dFormat: string,
|
||||
crntTime: number
|
||||
}
|
||||
>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<code>
|
||||
{{ `<t:${Math.floor(crntTime / 1000)}:${props.dFormat}>` }}
|
||||
</code>
|
||||
<span>
|
||||
to get
|
||||
<code>
|
||||
{{Intl.DateTimeFormat(Intl.Locale, format).format(crntTime).replace(" at ", " ") + ' '}}
|
||||
</code>
|
||||
</span>
|
||||
</template>
|
||||
Loading…
Add table
Add a link
Reference in a new issue