misc: Organize components
This commit is contained in:
1 parent
a5460a03b4
commit
7d3f29d9eb
17 files changed
+24
-22
No files matched your search
@@ -0,0 +1,9 @@
|
||||
<script lang="ts">
|
||||
export let number: number
|
||||
export let locale: string = 'en'
|
||||
export let options: Intl.NumberFormatOptions = {
|
||||
notation: 'compact',
|
||||
}
|
||||
</script>
|
||||
|
||||
<span>{Intl.NumberFormat(locale, options).format(number)}</span>
|
||||
@@ -0,0 +1,12 @@
|
||||
<script lang="ts">
|
||||
export let date: Date
|
||||
const rtf = new Intl.RelativeTimeFormat('en', {
|
||||
numeric: 'auto',
|
||||
style: 'short',
|
||||
}).format(
|
||||
Math.floor((date.getTime() - Date.now()) / 1000 / 60 / 60 / 24),
|
||||
'days'
|
||||
)
|
||||
</script>
|
||||
|
||||
{rtf}
|
||||
Reference in new issue
Block a user