<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)}
