Sanitize lib paths
This commit is contained in:
parent
8faa21ccab
commit
1b08805285
43 changed files with 68 additions and 66 deletions
18
ui/src/lib/components/DateRangeFormat.svelte
Normal file
18
ui/src/lib/components/DateRangeFormat.svelte
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<script>
|
||||
export let startDate;
|
||||
export let endDate;
|
||||
export let dateStyle;
|
||||
export let timeStyle;
|
||||
|
||||
function formatRange(startDate, endDate, dateStyle, timeStyle) {
|
||||
if (typeof input === 'string') {
|
||||
input = new Date(input);
|
||||
}
|
||||
return new Intl.DateTimeFormat(undefined, {
|
||||
dateStyle,
|
||||
timeStyle,
|
||||
}).formatRange(startDate, endDate);
|
||||
}
|
||||
</script>
|
||||
|
||||
{formatRange(startDate, endDate, dateStyle, timeStyle)}
|
||||
Loading…
Add table
Add a link
Reference in a new issue